[Story] Make Lua functions default to the user's language on multilingual wikis
Closed, ResolvedPublic

Description

On a multilingual wiki (where allowDataAccessInUserLanguage is true), the Lua functions should use the user's language (eg. for getting labels, but also for rendering Snaks or the like).

Details

Reference
bz73460
bzimport raised the priority of this task from to Normal.
bzimport set Reference to bz73460.
bzimport added a subscriber: Unknown Object (MLST).
hoo created this task.Nov 15 2014, 11:34 AM
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
hoo set Security to None.
mxn added a subscriber: mxn.Dec 5 2014, 5:10 AM
GWicke added a subscriber: GWicke.Dec 9 2014, 4:34 PM

Please make sure that the language(s) used are static for anything in the content of a page. In particular, it should not depend on the user interface language, as that would impose a heavy performance penalty on the user.

hoo updated the task description. (Show Details)Jul 19 2015, 5:07 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 19 2015, 5:07 PM
Jonas renamed this task from Sane Lua label access in non-content languages to [Story] Sane Lua label access in non-content languages.Sep 10 2015, 2:25 PM
hoo renamed this task from [Story] Sane Lua label access in non-content languages to [Story] Sane Lua label access in user language.Oct 5 2015, 8:41 AM
hoo updated the task description. (Show Details)
hoo updated the task description. (Show Details)Oct 5 2015, 8:43 AM
hoo renamed this task from [Story] Sane Lua label access in user language to [Story] Make DataAccess functions default to the user's language on multilingual wikis.Oct 5 2015, 1:40 PM
hoo updated the task description. (Show Details)
hoo renamed this task from [Story] Make DataAccess functions default to the user's language on multilingual wikis to [Story] Make Lua functions default to the user's language on multilingual wikis.
hoo updated the task description. (Show Details)

Change 243645 had a related patch set uploaded (by Hoo man):
Use the user's language in DataAccess if allowDataAccessInUserLanguage

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

Change 243645 merged by jenkins-bot:
Use the user's language in DataAccess if allowDataAccessInUserLanguage

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

hoo closed this task as Resolved.Oct 17 2015, 2:18 PM
hoo claimed this task.
hoo edited projects, added Wikidata-Sprint-2015-10-13; removed Patch-For-Review.
hoo moved this task from Proposed to Done on the Wikidata-Sprint-2015-10-13 board.
Zolo added a subscriber: Zolo.EditedAug 13 2016, 10:45 AM

There is a problem that we had not noticed before: T140792.

mw.wikibase.label() takes into account the user's default language, and does not change language when ?uselang=xx is added to the URL. This is
I see two possible solutions:

  1. change the behavior of mw.wikibase.label() so that it takes into account ?uselang
  2. provide a Lua function that retrieves the user's language using the same criteria as mw.wikibase.label() so that we can adapt Lua modules to fix the ?uselang= issue locally.