Page MenuHomePhabricator

Handle the mismatch in language codes for Konkani between CLDR and Mediawiki
Closed, ResolvedPublic

Description

CLDR has localisations for Konkani in the Devanagari script in the language code kok, while Mediawiki uses the code gom-deva for the same. This is likely to cause Mediawiki's CLDR extension to be unable to provide localisations in Konkani. There is a ticket in CLDR's bug tracking system to move the locale for Konkani (Devanagari script) from kok to gom-deva:

https://unicode-org.atlassian.net/browse/CLDR-17121

and another ticket to create the Konkani (Latin script) locale at gom-latn:

https://unicode-org.atlassian.net/browse/CLDR-17122

The ticket for the Latin script has the status as 'Accepted', which presumably means that we will see the CLDR locale being created, although we cannot be sure which code it will be created under.

Event Timeline

Change 961926 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/cldr@master] Load CLDR localisation for 'kok' for MediaWiki code 'gom-deva'

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

matmarex subscribed.

I'm not sure what's the best way to handle this in the code, since this is apparently the only language suffering from this problem, but I got something working.

@The_Discoverer Could you please try it out here, and confirm that everything is working as expected:

English-language content with Konkani interface language:
https://patchdemo.wmflabs.org/wikis/c9f662fc80/wiki/Talk:DiscussionTools?uselang=gom
https://patchdemo.wmflabs.org/wikis/c9f662fc80/wiki/Talk:DiscussionTools?uselang=gom-deva
https://patchdemo.wmflabs.org/wikis/c9f662fc80/wiki/Talk:DiscussionTools?uselang=gom-latn

Konkani-language wiki:
https://patchdemo.wmflabs.org/wikis/c906ab9a12/wiki/चर्चा:DiscussionTools


In gom-latn, the "time ago" phrases appear in English. I guess this is expected for now, since there isn't a locale we can use. If you want to fix that, I would need a full set of translations like this: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/cldr/+/1089799c1e0e0d0c18d0547cad1c37557349d28e/CldrNames/CldrNamesGom_deva.php#1034 (ignore everything above in this file) which I could include in MediaWiki's CLDR data overrides.

Thanks for the quick solution, @matmarex. I can't believe there could be such a relatively simple fix. I will provide you the php translations file for gom-latn in a day or two, focusing on the time strings, because these are what we need to solve the current bug.

Here is the translations php file for gom-latn:

I created this file using CldrNamesEn.php as the base.

Change 962661 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/cldr@master] Add local overrides for 'gom-latn'

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

Thanks for the translations! I'm adding the file in the patch above, after reformatting it a bit to fit the conventions (files for languages missing in CLDR are stored separately, so that they don't get accidentally deleted during routine updates; they also omit entries that weren't translated yet, or identical to English or other fallback languages).

Demo wiki for this patch:
https://patchdemo.wmflabs.org/wikis/9ce8194a8e/wiki/Talk:DiscussionTools?uselang=gom-latn

… focusing on the time strings, because these are what we need to solve the current bug.

Yes, please don't spend too much time on the rest, I don't think it's worth it, unless you want to contribute these translations to the CLDR project later. The language names are used in very few places (MediaWiki mostly displays language codes and autonyms, not local names, so e.g. https://en.wikipedia.org/wiki/Special:Preferences displays "de - Deutsch" and not "German"), although you can output them using {{#language:}} in wikitext templates. The currency and country names are not used anywhere at all in MediaWiki as far as I know, although they may be used in some fundraising/donation pages. Only the time units see a lot of use.

Change 961926 merged by jenkins-bot:

[mediawiki/extensions/cldr@master] Load CLDR localisation for 'kok' for MediaWiki code 'gom-deva'

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

Thanks @matmarex for the context and explanation. The Demo Wikis look fine.

Change 962661 merged by jenkins-bot:

[mediawiki/extensions/cldr@master] Add local overrides for 'gom-latn'

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