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).
Description
Details
- Reference
- bz73460
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Use the user's language in DataAccess if allowDataAccessInUserLanguage | mediawiki/extensions/Wikibase | master | +165 -101 |
Status | Subtype | Assigned | Task | |
---|---|---|---|---|
· · · | ||||
Open | None | T75087 Efficient entity label lookup (tracking) | ||
Resolved | None | T49930 [Epic] Allow accessing data from a Wikidata item not connected to the current page - arbitrary access | ||
Open | None | T76159 [Task] Preload labels and descriptions for Lua and the parser function based on usage tracking data | ||
Resolved | Lydia_Pintscher | T89002 multi-lingual label usage [Tracking] | ||
Resolved | hoo | T75460 [Story] Make Lua functions default to the user's language on multilingual wikis | ||
· · · |
Event Timeline
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.
Change 243645 had a related patch set uploaded (by Hoo man):
Use the user's language in DataAccess if allowDataAccessInUserLanguage
Change 243645 merged by jenkins-bot:
Use the user's language in DataAccess if allowDataAccessInUserLanguage
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:
- change the behavior of mw.wikibase.label() so that it takes into account ?uselang
- 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.
I've created T142906: Data access in user language doesn't obey the uselang get parameter for that.