hoo created this task. hoo added projects: Wikidata, MediaWiki-extensions-WikibaseClient. Herald added a subscriber: Aklapper. |
TASK DESCRIPTION
In T75460#2550259, @Zolo wrote: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.
Apparently ParserOptions::getUser()->getOption( 'language' ) doesn't provide the right language here, only ParserOptions::getUserLang() does. We use the former as an optimization in Scribunto_LuaWikibaseLibrary::getLanguage and Scribunto_LuaWikibaseEntityLibrary::getLanguage to only split the parser cache when actually needed.
As far as I see, we only call getLanguage when a Lua function is called anyway, so this hack probably doesn't save us much, so I suggest dropping it.
TASK DETAIL
EMAIL PREFERENCES
To: hoo
Cc: aude, daniel, hoo, Zolo, Aklapper, D3r1ck01, Izno, Wikidata-bugs, Mbch331
Cc: aude, daniel, hoo, Zolo, Aklapper, D3r1ck01, Izno, Wikidata-bugs, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs