Page MenuHomePhabricator

mw.wikibase.label does not always respect uselang=
Closed, DuplicatePublic

Description

See eg uselang=ar, uselang=de, uselang=zh, for mw.wikibase.label('Q1'). The page is much more likely to show the translations for "universe" with the language in the user's settings than the language in uselang parameter, and the latter should be the expected output of the module

Event Timeline

Templatek:Label in Commons (https://commons.wikimedia.org/wiki/Template:Label) used by citys template like Template:Berlin or Template:Athens but when I try to see it in he.wiki for example (same also in other wikis) it can be seen in English only but the link is ok. For example Athens in he.wiki or Berlin in ar.wiki. Lool loike the format is <nowiki>[[:he:אתונה|Athens]]</nowiki> and not <nowiki>[[:he:אתונה|אתונה]]</nowiki>. See her.

(I had some analysis before this task was created.)

My take on the problem:

There are 2 ways of specifying preferred language of interface and templates on Commons:

  1. You use ?uselang=ar switch on URL of the given page
  2. You provide language through your preferences

The first take precedent over the second one. I assume that links like file page as seen from he.wiki follows mechanism similar to calling the file with uselang=he.

It seems like mw.wikibase.label() function handles calls from pages with ?uselang= differently than interface or commons templates taking precedent of language provided through your preferences over ?uselang= switch.

I dont know if you have done any changes but I noticed that it was working ok in Athens case but not for Berlin so I changed small changes in Berlin template so it is similar to Athens - her, and it's working. It's looks ok now...