Lucas_Werkmeister_WMDE added a comment.
I can imagine three possible interfaces (not counting name variations): htmlCode = mw.language.bcp47( languageCode ) htmlCode = mw.language.new( languageCode ).bcp47 htmlCode = mw.language.new( languageCode ):bcp47() That is, a “static” method on `mw.language`, a field on an `mw.language` instance, or a method on an `mw.language` instance. Since `mw.language:getCode` is also a method, I think I’m leaning towards the third interface. There’s probably also some possible bikeshedding over whether we want to use the term “BCP 47” (and if yes, on its own or with “code” or “tag”), or call it an “HTML language code”, or something else. (I’m also tempted to add a method like `mw.html:inLanguage()` to `mw.html`, which would be a shortcut for setting the `lang` and `dir` attributes – in that case, the `bcp47()` method name wouldn’t matter as much, because most users wouldn’t use it directly.) TASK DETAIL https://phabricator.wikimedia.org/T310581 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Lucas_Werkmeister_WMDE Cc: Lucas_Werkmeister_WMDE, mrephabricator, Astuthiodit_1, karapayneWMDE, Invadibot, maantietaja, ItamarWMDE, Akuckartz, Nandana, Lahi, Gq86, GoranSMilovanovic, Mahir256, QZanden, LawExplorer, SundanceRaphael, _jensen, rosalieper, Bodhisattwa, Scott_WUaS, Nikki, alex-mashin, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Jackmcbarn, Mbch331
_______________________________________________ Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org