Hi folks,
I'm trying to add a "translate" link to [[:ro:Template:Ill-wd]] (which indicates a subject by it's wikidata id) and I need to determine the original language. Is there a way to determine if the current user prefers/knows some languages except the wiki's own language? I know I can use the interface language, but for the vast majority of users that's identical to the content language.
I vaguely remember that Content Translation asked be at some point about what languages it should use to provide suggestions, but I can't find that setting now. Does it still exist and is it available somehow from outside CX?
Are there any other data sources I can use (and which don't ruin caching, either)?
Thanks, Strainu
Hi!
I'm not sure if the approach would be valid for yout scenario, but in case you consider implementing it in JavaScript (as a gadget), you may want to use mw.uls.getFrequentLanguageList() (as used here: https://pl.wikipedia.org/wiki/MediaWiki:Gadget-interwiki-langlist.js#L-808 - it's a gadget for {{link-interwiki}} on plwiki).
Note that ULS is not available (or used not to be) in mobile version.
Cheers, Marcin pl:User:Msz2001
________________________________ From: Strainu strainu10@gmail.com Sent: Monday, January 8, 2024 7:54:23 AM To: Wikimedia developers wikitech-l@lists.wikimedia.org Subject: [Wikitech-l] "Known languages" or similar?
Hi folks,
I'm trying to add a "translate" link to [[:ro:Template:Ill-wd]] (which indicates a subject by it's wikidata id) and I need to determine the original language. Is there a way to determine if the current user prefers/knows some languages except the wiki's own language? I know I can use the interface language, but for the vast majority of users that's identical to the content language.
I vaguely remember that Content Translation asked be at some point about what languages it should use to provide suggestions, but I can't find that setting now. Does it still exist and is it available somehow from outside CX?
Are there any other data sources I can use (and which don't ruin caching, either)?
Thanks, Strainu
Am 08.01.2024 um 07:54 schrieb Strainu:
I'm trying to add a "translate" link to [[:ro:Template:Ill-wd]] (which indicates a subject by it's wikidata id) and I need to determine the original language. Is there a way to determine if the current user prefers/knows some languages except the wiki's own language? I know I can use the interface language, but for the vast majority of users that's identical to the content language.
MediaWiki core does not support this, but the Babel extension does. It offers an API, too: https://www.mediawiki.org/wiki/Extension:Babel
wikitech-l@lists.wikimedia.org