Page MenuHomePhabricator

Add fallback languages for the "no" dummy code
Open, Needs TriagePublic


For historical reasons, the language code "no" code is used where "nb" should have been used in a lot of Wikimedia Commons templates. The "no" code is mapped to "nb" in$wgExtraLanguageCodes , making this less of a problem. But it sometimes becomes a problem when templates fetch data from Wikidata, since only the "nb" code is used at Wikidata.

Templates often use the Lua method mw.language.getFallbacksFor() to find fallback languagages to check, which is great, since if we could only make mw.language.getFallbacksFor("no") return something like ["nb", "en"], many templates would work perfectly.

At the moment, mw.language.getFallbacksFor("no") only returns ["en"] though (Demonstration here: It seems like the method gets its data from the $fallback variable Messages*.php (through Language.php and LocalisationCache.php).

Currently, there is no MessagesNo.php file (pun intended). Would it work to add one (with $fallback = 'nb')? Or would that create a whole lot of mess?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 4 2019, 12:59 PM

We already have the following:

@Danmichaelo: Where exactly are those lines taken from? I cannot find any line for wgTranslateLanguageFallbacks in or so I don't know which place someone would have to look at.

@Danmichaelo: Could you please answer the last comment? Thanks in advance!

Danmichaelo updated the task description. (Show Details)Wed, Sep 11, 5:22 PM

Sorry @Aklapper for not noticing your question! Also, the file I originally referred to turned out to be one from the TranslateWiki repo, so not related to this issue at all. I've updated the issue description now.