cscott added a comment.
My only caution is that using strings to represent languages can be quite error-prone, given that there are different "string codes" floating around for the same language. In an ideal world, I'd say you should create a light-weight language object in lua that you can pass around without actually invoking mw.language.new (or bump the maxLangCacheSize only when actually loading the language file, not simply when creating the object). ::getBcp47Code() (or `::getHtmlCode()`) and `::getCode()` can be invoked on that lightweight object to make it clear which code you are using, and similarly, `mw.language.newFromBcp47()` and `mw.language.newFromMw()` would make it clear which "type of string" you are using to create the language object. TASK DETAIL https://phabricator.wikimedia.org/T310581 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: cscott Cc: cscott, mxn, Zebulon84, Tacsipacsi, Lucas_Werkmeister_WMDE, mrephabricator, LennardHofmann, Astuthiodit_1, karapayneWMDE, Invadibot, maantietaja, ItamarWMDE, Akuckartz, Nandana, Lahi, Gq86, GoranSMilovanovic, Mahir256, QZanden, LawExplorer, SundanceRaphael, _jensen, rosalieper, Scott_WUaS, Izno, 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