Page MenuHomePhabricator

Babel doesn't show localised messages for gom, gom-latn or gom-deva
Closed, ResolvedPublic

Description

If you use the code gom or gom-latn or gom-deva in Babel, the messages for the corresponding box are shown in English. For example:

https://gom.wikipedia.org/wiki/वापरपी:The_Discoverer
https://gom.wikipedia.org/wiki/वापरपी:Dcljr

The messages for gom-latn have been translated in TranslateWiki.net, so at least this code should work, but it doesn't.

Please note that the code gom falls back to gom-deva, which in turn falls back to hi.

Event Timeline

TTO added subscribers: Nikerabbit, TTO.

https://test2.wikipedia.org/wiki/User:This,_that_and_the_other

gom-N       This user has a native understanding of English.
gom-Deva-N  This user has a native understanding of [[User:This, that and the other|]].

The issue with gom-Deva and gom-Latn showing broken wikitext was fixed in https://gerrit.wikimedia.org/r/329733, which will be deployed to Wikimedia wikis in January.

The issue with gom seems to be separate. I sent a couple of hours trying to debug it and didn't make any progress. I did notice this though:

$ php maintenance/eval.php
> return wfMessage( 'moredotdotdot' )->inLanguage('gom')->text();
आनीक
> return wfMessage( 'moredotdotdot' )->inLanguage('gom-deva')->text();
आनीक
> return wfMessage( 'babel-N' )->inLanguage('gom')->text();
This user has a [[$1|native]] understanding of [[$2|$3]].
> return wfMessage( 'babel-N' )->inLanguage('gom-deva')->text();
इस सदस्य को [[$2|$3]] का [[$1|मातृभाषी के सामान]] ज्ञान है।
> return wfMessage( 'poem-desc' )->inLanguage('gom')->text();
Adds <code>&lt;poem&gt;</code> tag for poem formatting
> return wfMessage( 'poem-desc' )->inLanguage('gom-deva')->text();
कविता स्वरूपण के लिये <code>&lt;poem&gt;</code> टैग जोड़ता है

Clearly the fallback isn't working for extension messages when the exact code gom is used. It works for core messages though. @Nikerabbit: any idea what is wrong?

TTO triaged this task as Medium priority.Jan 1 2017, 11:03 AM

What do you mean?
https://translatewiki.net/w/i.php?title=MediaWiki:Babel-N/gom&action=edit is empty and gom has fallback to gom-deva.
https://translatewiki.net/w/i.php?title=MediaWiki:Babel-N/gom-deva&action=edit is empty and gom-deve has fallback to hi (but gom does not have it!)

@Nikerabbit: From the eval.php session pasted above, you can see that different fallback languages are used for the gom language code, depending on whether a message is defined in MW core (moredotdotdot falls back to some non-English language) or in an extension (babel-N, poem-desc falls back to en). Surely this is not expected behaviour?

There is no difference between core and extensions. Both extensions messages don't have translations in gom, hence they are taken from the defined fallbacks (hi and en respectively). Whether this makes sense is a different question, but it is working as expected.

The fallback chain is gom -> gom-deva -> hi -> en (confirmed from Messages*.php files), yet somehow hi is getting skipped for some of the messages for some reason (even though they all have translations in hi)? It's hard to see how that could be expected behaviour...

Fallback chains are not recursive, and haven't been for many years. For gom it is gom -> gom-deva -> en.

What do you mean?
https://translatewiki.net/w/i.php?title=MediaWiki:Babel-N/gom&action=edit is empty and gom has fallback to gom-deva.
https://translatewiki.net/w/i.php?title=MediaWiki:Babel-N/gom-deva&action=edit is empty and gom-deve has fallback to hi (but gom does not have it!)

So the fallback goes only one step? I wouldn't call it "recursive". I'm not sure I understand why is hi skipped and en is shown.

In any case, translating the needed messages to gom-deva sounds like the right thing to do.

I am not sure how I can say this clearer: The fallback list for gom is gom-deva, en. The fallback list for gom-deva is hi, en. It seems some forgot to add hi to the fallback list of gom to make it consistent.

Change 892046 had a related patch set uploaded (by Pppery; author: Pppery):

[mediawiki/core@master] Fix fallback flow for gom

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

Change 892046 merged by jenkins-bot:

[mediawiki/core@master] Fix fallback flow for gom

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

I am not sure how I can say this clearer: The fallback list for gom is gom-deva, en. The fallback list for gom-deva is hi, en. It seems some forgot to add hi to the fallback list of gom to make it consistent.

There is a revert request in T335758.