[BUG] UserScripts localization for zh-* broken on Firefox Android
JasonHK opened this issue · comments
Jason Kwok commented
Sequence of actions:
Problem:
Firefox for Android, weirdly, uses "zh-Hant-TW" instead of "zh-TW" as the language code for Traditional Chinese (Taiwan), which breaks the function (see below) used to get localized metadata since most (if not all) of the scripts use the code "zh-TW". Same should happen on Simplified Chinese (zh-CN, zh-Hans-CN).
violentmonkey/src/common/index.js
Line 159 in 5eb2c5a
Expected result:
Language code should be minimized first using function like new Intl.Locale("zh-Hant-TW").minimize().baseName // -> "zh-TW"
.
Devtools console contents:
N/A
Environment:
- OS: Android 14
- Browser: Firefox Nightly for Android 124.0a1
- Violentmonkey Version: 2.18.0