Page MenuHomePhabricator

Update cldr to latest released version
Closed, ResolvedPublic

Description

Seen when updating from current version 38 to version 39... nb and no are causing problems

From @Nikerabbit on https://gerrit.wikimedia.org/r/c/mediawiki/extensions/cldr/+/692597

This method seems to be rewriting CLDR codes to MediaWiki's expected values, so it looks correct. But maybe there is also nb in cldr? That would complicate things considerably.

Event Timeline

Change 738512 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/cldr@master] WIP:Update to cldr 40

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

On the above patch, without any remapping...

copy CldrNames/{CldrNamesNn.php => CldrNamesNo.php} (55%)

I stumbled into this new no/nb issue (just what we needed, right? 😛 ) when trying to contribute to CLDR earlier this summer, so I think I got a relatively decent overview of what's going on.

Basically, CLDR before this version had nb and nn separately, and no was set to fall back to nb. Except for this fallback, no was empty. However, because of the way fallbacks work in CLDR, that meant that nn had no other fallback than English. So what they did was to switch nb and no around. So everything that was in nb was moved to no (as the "main code"), and all CLDR localization for nb should be done in no. Then nn was set to fall back to no, so that nn translators/localizers would only have to add what is different from no (a whole bunch of things in CLDR would be identical for both of them).

As for what this implies for us, I'm not sure, because I don't know how CLDR works for us. But where we before had MW's nb => CLDR's nb, we should now have MW's nb => CLDR's no (although, since CLDR's nb is a fallback to no, maybe no change is necessary? But it may be better to circumvent that fallback). MW's nn => CLDR's nn should still be valid.

Change 738512 abandoned by Reedy:

[mediawiki/extensions/cldr@master] WIP:Update to cldr 40

Reason:

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

CLDR 42 was released some days ago. closing or renaming this task? https://cldr.unicode.org/index/downloads/cldr-42

Reedy renamed this task from Update cldr to version 40 to Update cldr to latest released version.Oct 23 2022, 11:43 PM

Change 866462 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/cldr@master] Update to cldr 42

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

Change 866462 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/cldr@master] Update to cldr 42

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

reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/extensions/cldr$ git commit -a
[master c57f3b9] Update to cldr 42
 144 files changed, 19982 insertions(+), 4604 deletions(-)
 create mode 100644 CldrNames/CldrNamesBho.php
 create mode 100644 CldrNames/CldrNamesCv.php
 rewrite CldrNames/CldrNamesEn_ca.php (83%)
 rewrite CldrNames/CldrNamesEn_gb.php (91%)
 create mode 100644 CldrNames/CldrNamesFrr.php
 create mode 100644 CldrNames/CldrNamesKea.php
 create mode 100644 CldrNames/CldrNamesKs_deva.php
 create mode 100644 CldrNames/CldrNamesMdf.php
 rewrite CldrNames/CldrNamesNn.php (64%)
 copy CldrNames/{CldrNamesNn.php => CldrNamesNo.php} (53%)
 create mode 100644 CldrNames/CldrNamesNyn.php
 create mode 100644 CldrNames/CldrNamesOc.php
 create mode 100644 CldrNames/CldrNamesPcm.php
 create mode 100644 CldrNames/CldrNamesSc.php
 create mode 100644 CldrNames/CldrNamesSe_fi.php
 create mode 100644 CldrNames/CldrNamesSms.php
 create mode 100644 CldrNames/CldrNamesYrl.php

No remapping done (may be needed, as was tested in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/cldr/+/692597/2/rebuild.php)

It'd be great to get this unblocked...

Is there a reason why the Norwegian changes couldn't be temporarily excluded, so that the other languages can be updated?

I have an old copy of MediaWiki (from 2020) in a VM and I tried testing how Norwegian behaves in that by adding $languageNames['en'] = "English from LocalNamesNo"; to LocalNamesNo.php and $languageNames['en'] = "English from LocalNamesNb"; to LocalNamesNb.php:

  • Special:PageLanguage?uselang=nb and Special:PageLanguage?uselang=no both show "English from LocalNamesNb"
  • Special:NewItem?uselang=nb and Special:NewItem?uselang=no also both show "English from LocalNamesNb"
  • {{#language:en|no}} shows "English from LocalNamesNo"
  • {{#language:en|nb}} shows "English from LocalNamesNb"

I tested how fallback behaves with translated messages on test.wikidata.org by creating one message with a no translation and another with a nb translation and both uselang=no and uselang=nb show English for the message with no and Norwegian for the message with nb. I also tested how fallback behaves with Wikidata items by adding a no label to https://test.wikidata.org/wiki/Q8372 and linking it from https://test.wikidata.org/wiki/Q8371. Both uselang=no and uselang=nb show the English label, not the no label.

So it seems MediaWiki immediately replaces no for the interface language with nb and then ignores no entirely, only using it when it's specifically requested for something other than the interface language. Perhaps no should be added as a fallback for nb? I tried setting $fallback in MessagesNb.php to "nn, no", added $languageNames['en-gb'] = "British English from LocalNamesNo"; to LocalNamesNo.php and that seemed to work - Special:PageLanguage showed en from LocalNamesNb.php and en-gb from LocalNamesNo.php.

We have extended fallbacks to include the macro language code for other languages, so we could do it for Norwegian as well. @jhsoby any concerns with that?

What needs to be done for that?

Update $fallback in Messages{Nb,Nn}.php to include no as the first option. After that, test again that CLDR returns appropriate results. And then there is the merge blocker for cldr currently that also needs resolving.

Change 890493 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@master] i18n: Add NO to NB and NN fallbacks

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

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/cldr/+/866462/ rebased onto HEAD and with https://gerrit.wikimedia.org/r/890493 applied on MW core...

similarity index 95%
rename from CldrNames/CldrNamesNb.php
rename to CldrNames/CldrNamesNo.php

The rename should be fine now. The fallback system should pick names from No when needed.

Change 890493 merged by jenkins-bot:

[mediawiki/core@master] i18n: Add no to fallback chain of nb and nn

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

Change 890865 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_39] i18n: Add no to fallback chain of nb and nn

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

Change 891286 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_38] i18n: Add no to fallback chain of nb and nn

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

Change 890865 merged by jenkins-bot:

[mediawiki/core@REL1_39] i18n: Add no to fallback chain of nb and nn

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

Change 891286 merged by jenkins-bot:

[mediawiki/core@REL1_38] i18n: Add no to fallback chain of nb and nn

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

Change 866462 merged by jenkins-bot:

[mediawiki/extensions/cldr@master] Update to cldr 42

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

Reedy claimed this task.