Page MenuHomePhabricator

Expose language fallback chain for user language in JS
Closed, ResolvedPublic

Description

Currently, there is only wgUserLanguage in the JS for the user language. Many user scripts use it to show the proper localization, but many don't use the correct fallback if localization is missing for that language (in most cases they just fall back to English). Just one example: https://www.wikidata.org/wiki/MediaWiki:Gadget-Merge.js has many localizations, but none for de-at or pfl. The script tries hard to provide good fallbacks, and will use German for de-at, but for pfl it will fall back to English. If the fallback chain (e.g. ['de-at', 'de', 'en'] or ['pfl', 'de', 'en']) would be exposed as JS variable, this would make localization of gadgets and user scripts much easier.


Version: 1.24rc
Severity: enhancement

Details

Reference
bz69285

Event Timeline

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

gerritadmin wrote:

Change 153002 had a related patch set uploaded by Bartosz Dziewoński:
[WIP] Expose language fallback chain in JavaScript

https://gerrit.wikimedia.org/r/153002

I wrote that patch for now because this seemed interesting :), but I probably won't have time to finish it soon (see commit message for the issues). If anyone wants to pick it up, feel free to.

(In reply to Bartosz Dziewoński from comment #2)

I wrote that patch for now because this seemed interesting :)

It is! Thanks.

gerritadmin wrote:

Change 153075 had a related patch set uploaded by Bartosz Dziewoński:
Expose language fallback chain in JavaScript

https://gerrit.wikimedia.org/r/153075

gerritadmin wrote:

Change 153075 merged by jenkins-bot:
mediawiki.language: Expose language fallback chain

https://gerrit.wikimedia.org/r/153075

gerritadmin wrote:

Change 153002 abandoned by Bartosz Dziewoński:
[WIP] Add utility methods for language fallback chain handling in JavaScript

Reason:
Doesn't seem anybody is terribly interested in these. If anyone cares, please pick this up under your own name.

https://gerrit.wikimedia.org/r/153002