Jarekt added a comment.
In T68051#6080295 <https://phabricator.wikimedia.org/T68051#6080295>, @matej_suchanek wrote: > If this way of getting the language works for you, then ... @matej_suchanek This approach //seems //to work in limited test I was able to perform. Q2 has labels for 287 languages and I believe MediaWiki supports over 450, so this approach would not work for users of 160 languages, but there again those are probably the languages we do not have any content in anyway. Function mw.wikibase.getLabelWithLang <https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua#mw.wikibase.getLabelWithLang> does on document what the language output is. By observation it seem to be the language of the viewer, but it is unclear how many languages can be returned. Mw.language <https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.language> library recognizes language codes which are ValidBuiltIn <https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.language.isValidBuiltInCode>, Known <https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.language.isKnownLanguageTag>, or supported <https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.language.isSupportedLanguage>, It would be nice to know which set the outputs of this function fall into. In T68051#6080295 <https://phabricator.wikimedia.org/T68051#6080295>, @matej_suchanek wrote: > perhaps it could be moved to a new function to work independently of Wikidata... A //new function to work independently of Wikidata// would be great. Perhaps `mw.language.getUserLanguage()` (aka `mw.getUserLanguage()`) to get "language object" with `getCode()` property to get the actual language code. In T68051#6080295 <https://phabricator.wikimedia.org/T68051#6080295>, @matej_suchanek wrote: > Also, this will create 50M "links" to the item in the database of Commons, so a potential performance problem. Yes, we would like to avoid that. Once Commons SQL database have 50M links, they do not seem to ever go away. As I reported in T243602 <https://phabricator.wikimedia.org/T243602>, we still have 13M links to some modules and templates which are not being used for over a year. TASK DETAIL https://phabricator.wikimedia.org/T68051 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Jarekt Cc: matej_suchanek, Want, Perhelion, IKhitron, Iniquity, Dvorapa, daniel, Ricordisamoa, Capankajsmilyo, zhuyifei1999, Jackmcbarn, Liuxinyu970226, Rama, Jarekt, Multichill, Aklapper, Rical, Nemo_bis, Anomie, He7d3r, tstarling, wikibugs-l-list, vvv, darthmon_wmde, Nandana, Lahi, Gq86, Af420, GoranSMilovanovic, QZanden, LawExplorer, SundanceRaphael, _jensen, rosalieper, Scott_WUaS, MuhammadShuaib, LNDDYL, Psychoslave, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Arrbee, KartikMistry, Mbch331, Jay8g
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs