Page MenuHomePhabricator

i18n fallback uses message from i18n file before customized message from DB (MediaWiki: namespace)
Closed, DuplicatePublic

Description

Since some months, the license text selector language fallback is broken at Commons:
https://commons.wikimedia.org/wiki/Commons:Village_pump#Can_somebody_help.3F_.22No_license_specified.22
https://commons.wikimedia.org/w/index.php?title=Commons:Village_pump&oldid=106628661#Can_somebody_help.3F_.22No_license_specified.22

It apparently worked before (but I am not sure):
https://commons.wikimedia.org/w/index.php?title=Special%3ALog&type=&user=&page=MediaWiki%3ALicenses%2Fnn&year=&month=-1&tagfilter=&hide_patrol_log=1
(message deleted because it was redundant to the English version)

How to reproduce:
Go to https://commons.wikimedia.org/wiki/Special:Upload?uselang=de-at
and the Lizenz:-<select> only contains one entry. This is because [[MediaWiki:Licenses/de-at]] does not exist. I would, however, expect that in this case [[MediaWiki:Licenses/de]] is used.


URL: https://commons.wikimedia.org/wiki/Commons:Village_pump/Archive/2013/10#Can_somebody_help.3F_.22No_license_specified.22
See Also: T3495: Improve message source fallback flow

Details

Reference
bz55473

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:16 AM
bzimport set Reference to bz55473.

kjerstil.ubit wrote:

Thank you so much for fixing this bug!
*This was the problem in the Norwegian uploading form:
*There were licensing options at Commons:Upload before they disappeared a few months ago (using option "It is from somewhere else") which links directly to Special:Upload
*I did not change my language preferences.
Now everthing is in order again!
I have never commented here in Bugzilla before, so I do not know how to sign here. Maybe I do, just by being logged on? Commons-user: Kjersti Lie

(In reply to comment #1)

Now everthing is in order again!

This is because https://commons.wikimedia.org/wiki/MediaWiki:Licenses/nb is now in place. The bug that the fallback language logic is broken still persists.

I have never commented here in Bugzilla before,
so I do not know how to sign here.

No need to do so. Unfortunately there is no means connecting your Wikimedia Commons/Wikipedia account with Bugzilla

Thank you so much for fixing this bug!

Thank you for commenting here and welcome at Bugzilla!
Andre Klapper is our Bug wrangler (the person who makes sure Bugzilla runs).

(In reply to comment #2)

No need to do so. Unfortunately there is no means connecting your Wikimedia
Commons/Wikipedia account with Bugzilla

For the records, that's bug 14487 and we'll take a look in the next months.

Thanks for reporting this, Rainer!

We will investigate the cause of the problem, then determine what will be required to fix it, then prioritize it based on that new information.

Please let us know if you come across anything useful on your end that could help us find the source of this issue.

(In reply to comment #0)

Since some months, the license text selector language fallback is broken at
Commons:
https://commons.wikimedia.org/wiki/Commons:Village_pump#Can_somebody_help.
3F_.22No_license_specified.22
https://commons.wikimedia.org/w/index.php?title=Commons:
Village_pump&oldid=106628661#Can_somebody_help.3F_.22No_license_specified.22

It apparently worked before (but I am not sure):
https://commons.wikimedia.org/w/index.
php?title=Special%3ALog&type=&user=&page=MediaWiki%3ALicenses%2Fnn&year=&mont
h=-1&tagfilter=&hide_patrol_log=1
(message deleted because it was redundant to the English version)

How to reproduce:
Go to https://commons.wikimedia.org/wiki/Special:Upload?uselang=de-at
and the Lizenz:-<select> only contains one entry. This is because
[[MediaWiki:Licenses/de-at]] does not exist. I would, however, expect that in
this case [[MediaWiki:Licenses/de]] is used.

I imagine introduced in 86b54375de7e / attempts to fix bug 1495, as that was last major change to this code area.

MediaWiki:Licenses is a special message that only exists in the English messages file, with a '-' value. Before 86b54375de7e, MessageCache::get() had special handling for messages whose value was exactly '-', so the lookup went like this:

  • check DB for current lang (miss)
  • check CDB ('-')
  • special handling for '-': check DB for default lang (returns the english license list)

Since 86b54375de7e, lookup goes like this:

  • check DB for current lang (miss)
  • check CDB ('-')
  • use '-' as the license list (lines not starting with '*' are ignored, so this is the same as an empty list)

The root problem is that DB lookups return the current language or null, while CDB lookups include fallbacks, so a CDB fallback will take precedence over a DB fallback which is at the same or higher position in the fallback chain. This causes a lot of other problems apart from this bug, and a patch is already pending: https://gerrit.wikimedia.org/r/#/c/72867/

Once that gets merged, the lookup will look like this:

  • check DB for current lang (miss)
  • check CDB for current lang (miss)
  • walk back fallback chain, check first DB then CDB for each (eventually gets English license list or a localization)

which fixes this bug and is actually an improvement over the old (which returned English and not German license list for 'de-at').

It seems that that patch is stuck in review limbo, though.

For clarity, the current plan is Niklas' option 1 as per bug 46579 comment 17.

Change 72867 had a related patch set uploaded by Parent5446:
Complete usage of message fallback chain

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

(In reply to comment #8)

For clarity, the current plan is Niklas' option 1 as per bug 46579 comment

Is it? 86b54375de7e, which was merged half a year ago, takes a completely different direction.

Anyway, if that option would be implemented, that would fix this bug as well, although then MediaWiki:Licenses should be moved to MediaWiki:Licenses/en.

(In reply to comment #10)

(In reply to comment #8)

For clarity, the current plan is Niklas' option 1 as per bug 46579 comment

Is it? 86b54375de7e, which was merged half a year ago, takes a completely
different direction.

That's only temporary, doing everything at once was too much.

Anyway, if that option would be implemented, [...]
then MediaWiki:Licenses should be moved to MediaWiki:Licenses/en.

Yep, it should.

(In reply to comment #11)

That's only temporary, doing everything at once was too much.

And breaking existing things? No, then you can surely make use of branches.

Anyway, independently from what is being implemented, I would be glad having a link to a documentation page for that behaviour here so I can check existing messages at Commons. Thank you.

Tgr removed Tgr as the assignee of this task.Dec 23 2014, 11:13 PM

I don't understand the question.

TTO renamed this task from [REGRESSION] i18n fallback uses message from i18n file before message from db. to i18n fallback uses message from i18n file before customized message from DB (MediaWiki: namespace).Feb 17 2017, 2:59 AM
TTO updated the task description. (Show Details)