Page MenuHomePhabricator

Update the script of making templates static mapping files
Open, LowPublic

Description

We have the ticket of update app languages list
https://phabricator.wikimedia.org/T263471

The app now supports more language codes and we'll need to update the template static mapping files as well.

Person who pick up the ticket will update the make-templates.py.

The best result will be: in the static files, the sizes of the data maps align with the total language lists in languages_list.xml -> preference_language_keys

Event Timeline

Is this in fact necessary?
AFAIK, even for different language variants, the names of wiki namespaces is always the same (default variant). For example, in Uzbek wikipedia the name for the Talk namespace is Munozara, regardless of whether the variant is Latin or Cyrillic.

If we add all the static names for all variants, would it just be a lot of redundancy?

@Dbrant
I agreed somehow it is a bit of redundancy.

But I did see an issue sometimes that the SiteInfoClient.getMainPageForLang() will get a null when fetching the SiteInfo and will continue mapping the language code from MainPageNameData, which some of the language variants code do not have data in it. (e.g. zh-tw)

If cannot find the corresponding key from the map, we will get the default main page (Main Page) for it
zh-tw: Main Page vs zh-hant: Wikipedia:首页
https://zh.wikipedia.org/api/rest_v1/page/summary/Main_Page -> incorrect
https://zh.wikipedia.org/api/rest_v1/page/summary/Wikipedia:首頁 -> correct