Last modified: 2014-10-16 20:55:16 UTC
Currently, this function is worked for currrent page only: called as {{#translation:}} and is returned "/code", if page is translation, or empty string otherwise. Proposed update for ability to using this function for specified target page, as {{#translation:pagename}} or {{#translation:namespace:pagename}}. This will be useful for eliminate widely used templates {{ifTranslation}}/{{ifNotTranslation}}, {{TNT}}/{{TNTN}} and {{Ll}}. Taret result for my proposal: 1) if current page is translation, and {{#translation:}} is returned "/code", then {{#translation:pagename}} should be return "pagename/code" (if this page is exist) or "pagename" otherwise; 2) if current page is _not_ a translation, and {{#translation:}} is returned empty result, {{#translation:pagename}} should be return "pagename" Note: maybe this should be separate magic word, as '#tlink' or '#tl' (or simple create these short aliases for this function)?
Can you explain me how exactly could the templates be replaced with this magic word? For TNT, would it work like this: If I am on page, Foo/fi would {{#translation:Template}} return Template/fi if that page exists and Template otherwise? Then you would call it as {{{{#translation:Template}}}}. What about the other templates? I'm not familiar with what they do.
Yes; explanations: {{TNT|Template}} > {{ {{#translation:Template}} }} {{TNTN|Template}} > {{#translation:Template}} (currently, these same, but without transcluding) {{Ll}} will receive the code more simple, by eliminating calls {{tntn}} (see https://www.mediawiki.org/w/index.php?title=Template:Localized_link&action=edit ) {{ifTranslation}}/{{ifNotTranslation}} - they are nothing to do with, I was mistaken ;) But they used Module:Template_translation (see https://meta.wikimedia.org/wiki/Module:Template_translation) - maybe it's code also possible to simplify (if this feature has available through API)?