mirror of
https://github.com/penpot/penpot.git
synced 2026-11-28 14:14:23 +00:00
🐛 Fix Japanese autodetection fallback on "ja" locale (#12283)
Most browsers return "ja" rather than "ja-JP" in navigator.language. Because parse-locale expands "ja-JP" to ["ja_jp" "ja"] but keeps "ja" as ["ja"], using "ja_jp" causes autodetection to fall back to English. Normalize the Japanese locale identifier to "ja" and map jpn_JP.po to translation.ja.js, matching other single-region locales like Ukrainian. AI-assisted-by: gemini-3.8-flash
This commit is contained in:
parent
b19ad65581
commit
029d9c0af7
@ -328,7 +328,7 @@ export async function compileTranslations() {
|
||||
"nl",
|
||||
// this happens when file does not matches correct
|
||||
// iso code for the language.
|
||||
["ja_jp", "jpn_JP"],
|
||||
["ja", "jpn_JP"],
|
||||
["uk", "ukr_UA"],
|
||||
"ha",
|
||||
];
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
{:label "आधुनिक मानक हिन्दी (community)" :value "hi"}
|
||||
{:label "عربي/عربى (community)" :value "ar"}
|
||||
{:label "فارسی (community)" :value "fa"}
|
||||
{:label "日本語 (Community)" :value "ja_jp"}
|
||||
{:label "日本語 (Community)" :value "ja"}
|
||||
{:label "简体中文 (community)" :value "zh_cn"}
|
||||
{:label "繁體中文 (community)" :value "zh_hant"}])
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user