Page MenuHomePhabricator

Add {{#translation}} as parser function in the Translate extension
Closed, ResolvedPublic

Description

Author: pr4tiklahoti

Description:
{{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.


Version: unspecified
Severity: normal

Details

Reference
bz68385

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:39 AM
bzimport set Reference to bz68385.

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.

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)

Not a very good idea. In my opinion, '#translation' should not be generate wikilinks, only pagename in plain text.

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:

(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)

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)

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

Base noted that the feature had not been documented. I've corrected the manual where it said that there is no support for this feature: https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&diff=prev&oldid=1779724