Page MenuHomePhabricator

{{#language:...}} should support variable language **output** as well as input (CLDR)
Closed, ResolvedPublic


Author: happy_melon

It would be very useful for the {{#language:...}} parser function to take a second parameter, which is the language in which the name of the language *code* given in the first parameter should be displayed. Eg:

{{#language:en|en}} == {{#language:en}} --> English
{{#language:en|fr}} --> Anglais
{{#language:fr|en}} --> French
{{#language:fr|fr}} == {{#language:fr}} --> Français

This is after discussion at VPR ( ) where we considered the usefulness of such a template. It essentially requires an array approximately 185x185 containing the name of every language in every other language; someone pointed out that this content is being created (slowly!) at ; some is already available in our svn ( ).

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:24 PM
bzimport set Reference to bz16699.
bzimport added a subscriber: Unknown Object (MLST).

This has been experimentally worked on in the CLDR extension:

Probably pretty straightforward if we want to go ahead and adapt it; there doesn't seem to be a live dependency, the CLDR DB is used to generate lists which can be used in straight PHP.

Should the summary of this request be changed to a request to enable the CLDR extension on en.wp or all Wikimedia wikis?

One thing to consider: as the CLDR extension is a derivative work of the CLDR database, making custom additions, even though possible, is quite unwanted, as it fragments what should indeed be maintained centrally in CLDR. We have been using this extension for a long while already at Betawiki, and the issue has always been to get updates/corrections from our users into CLDR; this is a problem that is yet to be resolved[1]. I would call upon anyone with a drive to pick this up.


Update domain to Wikimedia/Site requests, adding keyword 'review-needed', to request enabling this on Wikimedia wikis.

This functionality is now written into the {{#languagename}} parser function that is part of the i18nTags extension (although dependent on the CLDR extension). See bug 9465.

If it's OK with Niklas, I'm hoping to move this parser function out of i18nTags and into CLDR instead.

Recommend marking this bug WONTFIX.

(In reply to comment #4)

If it's OK with Niklas, I'm hoping to move this parser function out of i18nTags
and into CLDR instead.

Yes, that's OK :).

Well, turns out we may just drop {{#languagename}} entirely and port it to {{#language}} instead, which is probably the most sensible thing in the long run.

Zoloinwiki wrote:

We could make good use of this in Commons [ template:language] that is used in about 400,000 pages. However, for languages that are not in the CDLR, the current template can be more comprehensive than the parser. Eg language|sli|fr and language|ug-arab|fr return French translations while the parser returns "Lower Silesian" and "ئۇيغۇرچە" (more examples at [ User:Zolo/test3]. Since the parser returns original language or English instead of just the code, I imagine that it should be fixable. Would it be possible to export Commons data so that we can make use of the parser ?

Yes, we can pass data back up to the CLDR database for inclusion and then it will eventually be available through {{#language}}. I would suggest emailing Amir Aharoni ( and tell him what data you would like added to CLDR.