Last modified: 2014-09-22 09:38:12 UTC
{{translate}} needs to be added as a magic word for it to be used by Special:PagePreparation, a tool for preparing the page for translation.
Cc the creator of [[mw:Template:Translation]], Happy-melon, and some others, in case they want to specify some requirements for such a magic word.
Change 148759 had a related patch set uploaded by BPositive: 'translation' added as magic word in Translate extension https://gerrit.wikimedia.org/r/148759
I want the magic word to start with # sign.
Niklas veto'ed any {{translation}} magic word for fear of incompatibility with existing templates, so it's useless to discuss about it. For now making a non-standard magic word prefixed by # is easiest. As compatibility with existing wikitext is no longer an aim, should we also change the syntax from [[Category:A{{translation}}|B]] to {{#translation:Category:A|B}} (in a followup patch)? The {{#translation}} parser function could also be used to transclude translatable templates in the future: is this in scope for Translate, Niklas? If the answer is yes, BPositive, please file a separate bug for that.
Change 148759 merged by jenkins-bot: '#translation' added as magic word in Translate extension https://gerrit.wikimedia.org/r/148759
(In reply to Nemo from comment #4) > As compatibility with existing wikitext is no longer an aim, should we also > change the syntax from [[Category:A{{translation}}|B]] to > {{#translation:Category:A|B}} (in a followup patch)? Not a very good idea. In my opinion, '#translation' should not be generate wikilinks, only pagename in plain text. Instead [[Category:A{{translation}}|B]] should be approximately next code: [[{{#translation:Category:A}}|B]]. By common way, pipe ("|") is traditionally used as delimanation simbol for parser functions; it may still be needed in this case.
Niklas, maybe update this feature, to make it work not only for currrent page, as {{#translation:}} (current state) - but also 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}}.
(In addition to comment #7) 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"
(In addition to comment #7 and comment #8) maybe this should be separate magic word, as '#tlink' or '#tl'?
(In reply to Paul Kaganer from comment #8) > 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" This sounds reasonable to me, and hopefully not too hard to implement (especially if reusing some Special:MyLanguage code to find the appropriate target subpage). Are you able to submit a patch (I don't think Pratik will have time during GSoC).
(In reply to Nemo from comment #10) > Are you able to submit a patch (I don't think Pratik will > have time during GSoC). No, I do not have such skills. Let's wait for someone who can do it :(
1.24 was branched, let's have a closed bug against 1.24 for bugzilla searchers. (In reply to Nemo from comment #10) > (In reply to Paul Kaganer from comment #8) > > 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" > > This sounds reasonable to me, and hopefully not too hard to implement > (especially if reusing some Special:MyLanguage code to find the appropriate > target subpage). Are you able to submit a patch (I don't think Pratik will > have time during GSoC). Kaganer, can you file these as a separate bug?
> Kaganer, can you file these as a separate bug? Nemo, see bug 71114