Page MenuHomePhabricator

[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

Event Timeline

• bzimport raised the priority of this task from to Medium.Nov 22 2014, 4:00 AM
• bzimport set Reference to bz73460.
• bzimport added a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).

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.

• 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 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 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)
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 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.

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.