Hi. Is there a way for javascript to retrieve the current personal list of recommended languages that appears at the top of the language selector when navigating with interwiki? Thank you, Igal (User:IKhitron)
Hi!
On 12/13/22 12:40, Igal Khitron wrote:
Hi. Is there a way for javascript to retrieve the current personal list of recommended languages that appears at the top of the language selector when navigating with interwiki?
Yep, you can use the API module: https://www.mediawiki.org/w/api.php?modules=query+babel.
-- Kunal / Legoktm
Hi,
I’ve stumbled upon `mw.uls.getFrequentLanguageList()`, however I’m unable to find its documentation at the moment. The function returns an array of language codes for suggested languages (independent of the current article, i.e. you’ll get the same list regardless of any interwiki present on a current page).
I’ve used it here, if you’d like to see it in action: https://pl.wikipedia.org/wiki/MediaWiki:Gadget-interwiki-langlist.js#L-772
Cheers, Marcin Szwarc
Od: Igal Khitronmailto:khitron@gmail.com Wysłano: wtorek, 13 grudnia 2022 18:41 Do: Wikimedia developersmailto:wikitech-l@lists.wikimedia.org Temat: [Wikitech-l] Babel
Hi. Is there a way for javascript to retrieve the current personal list of recommended languages that appears at the top of the language selector when navigating with interwiki? Thank you, Igal (User:IKhitron)
Thanks a lot. Igal
בתאריך יום ג׳, 13 בדצמ׳ 2022, 19:51, מאת Marcin Szwarc < marcinszwarc@hotmail.com>:
Hi,
I’ve stumbled upon `mw.uls.getFrequentLanguageList()`, however I’m unable to find its documentation at the moment. The function returns an array of language codes for suggested languages (independent of the current article, i.e. you’ll get the same list regardless of any interwiki present on a current page).
I’ve used it here, if you’d like to see it in action: https://pl.wikipedia.org/wiki/MediaWiki:Gadget-interwiki-langlist.js#L-772
Cheers,
Marcin Szwarc
*Od: *Igal Khitron khitron@gmail.com *Wysłano: *wtorek, 13 grudnia 2022 18:41 *Do: *Wikimedia developers wikitech-l@lists.wikimedia.org *Temat: *[Wikitech-l] Babel
Hi. Is there a way for javascript to retrieve the current personal list of recommended languages that appears at the top of the language selector when navigating with interwiki?
Thank you,
Igal (User:IKhitron)
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
wikitech-l@lists.wikimedia.org