Page MenuHomePhabricator

Update language variants localized names in the apps
Open, LowPublic

Description

When requesting meta=siteinfo for languages|languagevariants, Chinese language variants' outputs seem inconsistent with the desktop settings.

https://www.mediawiki.org/w/api.php?action=query&format=json&meta=siteinfo&formatversion=2&siprop=languages|languagevariants

The screenshot of the Android app using the siteinfo endpoint.

Screenshot_20240520_163705_Wikipedia.jpg (2×1 px, 71 KB)

The screenshot of the desktop zhwiki.

Screenshot 2024-05-28 at 08-40-42 Wikipedia.png (281×283 px, 28 KB)

The static language list file should be updated for the language variants from meta=languageinfo instead of the language names from siteinfo.

https://www.mediawiki.org/w/api.php?action=query&format=json&meta=languageinfo&formatversion=2&liprop=variantnames%7Cvariants&licode=zh

Please note that we should send the corresponding licode when requesting the endpoint.

Current

		'zh-cn' => '中文(中国大陆)', # Chinese (PRC)
		'zh-hans' => '中文(简体)', # Mandarin Chinese (Simplified Chinese script) (cmn-hans)
		'zh-hant' => '中文(繁體)', # Mandarin Chinese (Traditional Chinese script) (cmn-hant)
		'zh-hk' => '中文(香港)', # Chinese (Hong Kong)
		'zh-mo' => '中文(澳門)', # Chinese (Macau)
		'zh-my' => '中文(马来西亚)', # Chinese (Malaysia)
		'zh-sg' => '中文(新加坡)', # Chinese (Singapore)
		'zh-tw' => '中文(臺灣)', # Chinese (Taiwan)

Proposed

		'zh-cn' => '大陆简体', # Chinese (PRC)
		'zh-hans' => '简体中文', # Mandarin Chinese (Simplified Chinese script) (cmn-hans)
		'zh-hant' => '繁體中文', # Mandarin Chinese (Traditional Chinese script) (cmn-hant)
		'zh-hk' => '香港繁體', # Chinese (Hong Kong)
		'zh-mo' => '澳門繁體', # Chinese (Macau)
		'zh-my' => '大马简体', # Chinese (Malaysia)
		'zh-sg' => '新加坡简体', # Chinese (Singapore)
		'zh-tw' => '臺灣正體', # Chinese (Taiwan)

Event Timeline

@cooltey

F54544080 is "language name"

Screenshot_20240520_163705_Wikipedia.jpg (2×1 px, 71 KB)

F54544129 is "language variant name"

Screenshot 2024-05-28 at 08-40-42 Wikipedia.png (281×283 px, 28 KB)

"language name" and "language variant name" are different, please don't mix them together or conflate them.

Variant names can be obtained from the meta=languageinfo API (see also T302200), play with API sandbox for more parameters

Thanks! @Winston_Sung and @Func, I will update the ticket description and tags for the apps team.

cooltey renamed this task from Update Chinese localized language names in Names.php to Update Chinese localized language names in the apps.Tue, May 28, 4:43 PM
cooltey renamed this task from Update Chinese localized language names in the apps to Update language variants localized names in the apps.
cooltey updated the task description. (Show Details)
cooltey updated the task description. (Show Details)
HNordeenWMF moved this task from Needs Triage to Up next on the Wikipedia-iOS-App-Backlog board.
HNordeenWMF subscribed.

iOS will pick this up after Android, please don't close the task after release

Just made a PR of this, but I think this ticket should not be processed because of the following findings:

Some localized names are duplicated, for example:
https://www.mediawiki.org/w/api.php?action=query&format=json&meta=languageinfo&formatversion=2&liprop=variantnames&licode=gan
https://www.mediawiki.org/w/api.php?action=query&format=json&meta=languageinfo&formatversion=2&liprop=variantnames&licode=zh

For both gan-hant and zh-hant, the localized name is 繁體.

So far I am not able to verify the other languages, but I would suggest we can only limit the changes to zhwiki only.

"language variant names" would not include the "language name" part, so it is intended that

  • "gan-hant" => "hant"
  • "wuu-hant" => "hant"
  • "zh-hant" => "hant"

"hant" === "hant" === "hant"

  • "Add a language" should only show language names.
  • "language variant names" should only show in something like:
    • "Add a language variant"
    • "Choose the language variant (of the language)"

I also agree with @Winston_Sung that we should not mix these two and the status quo is OK to me.

If the problem originates from T360585, IMHO using the language name ("中文(XXX)") in the prompt also seems OK to me, if we do not want to introduce more complexity.

Thank you for your valuable feedback, @Winston_Sung and @Diskdance. We will keep the current design with the endpoint response instead. Move this ticket to Garage for now.