From 029d9c0af7f4ada4737a945406179b4c9a51f031 Mon Sep 17 00:00:00 2001 From: GennoBou <121762542+GennoBou@users.noreply.github.com> Date: Wed, 4 Nov 2026 00:11:22 +0900 Subject: [PATCH] :bug: 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 --- frontend/scripts/_helpers.js | 2 +- frontend/src/app/util/i18n.cljs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/scripts/_helpers.js b/frontend/scripts/_helpers.js index 9a6bf14ec8..2b59eb9038 100644 --- a/frontend/scripts/_helpers.js +++ b/frontend/scripts/_helpers.js @@ -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", ]; diff --git a/frontend/src/app/util/i18n.cljs b/frontend/src/app/util/i18n.cljs index ce7712ae4e..d36b2872c7 100644 --- a/frontend/src/app/util/i18n.cljs +++ b/frontend/src/app/util/i18n.cljs @@ -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"}])