From 278b1c92b3812946e0a93cf9dad80bfdfbae1a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammet=20Eren=20Karaku=C5=9F?= Date: Mon, 2 Mar 2026 11:05:45 +0300 Subject: [PATCH 1/2] fix(i18n): correct Irish locale flag and language label - Fix locale key in lang-list.json from "locale-ie-GA" to "locale-ga-IE" to match the actual locale code used in IntlProvider - Add ga -> ie mapping in getFlagCodeForLocale() so the Ireland flag is shown instead of the Gabon flag - Add missing ["ga", "ga-IE"] entry to check-locales.cjs validation list Fixes NginxProxyManager/nginx-proxy-manager#5354 --- frontend/check-locales.cjs | 1 + frontend/src/locale/IntlProvider.tsx | 1 + frontend/src/locale/src/lang-list.json | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/check-locales.cjs b/frontend/check-locales.cjs index 75d2d8fce7..deb418a3ec 100755 --- a/frontend/check-locales.cjs +++ b/frontend/check-locales.cjs @@ -13,6 +13,7 @@ const allLocales = [ ["es", "es-ES"], ["et", "et-EE"], ["fr", "fr-FR"], + ["ga", "ga-IE"], ["it", "it-IT"], ["ja", "ja-JP"], ["nl", "nl-NL"], diff --git a/frontend/src/locale/IntlProvider.tsx b/frontend/src/locale/IntlProvider.tsx index dabe81b5e5..a5fb956c0d 100755 --- a/frontend/src/locale/IntlProvider.tsx +++ b/frontend/src/locale/IntlProvider.tsx @@ -72,6 +72,7 @@ const getFlagCodeForLocale = (locale?: string) => { vi: "vn", // Vietnam ko: "kr", // Korea cs: "cz", // Czechia + ga: "ie", // Ireland (Irish) }; if (specialCases[thisLocale]) { diff --git a/frontend/src/locale/src/lang-list.json b/frontend/src/locale/src/lang-list.json index 79dabe22b5..2e7112cf48 100644 --- a/frontend/src/locale/src/lang-list.json +++ b/frontend/src/locale/src/lang-list.json @@ -8,7 +8,7 @@ "locale-et-EE": { "defaultMessage": "Eesti" }, - "locale-ie-GA": { + "locale-ga-IE": { "defaultMessage": "Gaeilge" }, "locale-de-DE": { From cbcbd95812035ab291f34c625b56f3604a2cb764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammet=20Eren=20Karaku=C5=9F?= Date: Mon, 2 Mar 2026 11:15:03 +0300 Subject: [PATCH 2/2] test(i18n): add tests for getFlagCodeForLocale flag mapping Cover standard locales, all special-case mappings (ja, zh, vi, ko, cs, ga), and the undefined/fallback path to prevent future flag regressions. --- frontend/src/locale/Utils.test.tsx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/frontend/src/locale/Utils.test.tsx b/frontend/src/locale/Utils.test.tsx index e998dc319c..a49460fee0 100644 --- a/frontend/src/locale/Utils.test.tsx +++ b/frontend/src/locale/Utils.test.tsx @@ -1,4 +1,4 @@ -import { formatDateTime } from "src/locale"; +import { formatDateTime, getFlagCodeForLocale } from "src/locale"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; describe("DateFormatter", () => { @@ -72,3 +72,28 @@ describe("DateFormatter", () => { expect(text).toBe("-100"); }); }); + +describe("getFlagCodeForLocale", () => { + it("returns correct flag code for standard locales", () => { + expect(getFlagCodeForLocale("en-US")).toBe("EN"); + expect(getFlagCodeForLocale("de-DE")).toBe("DE"); + expect(getFlagCodeForLocale("fr-FR")).toBe("FR"); + }); + + it("returns correct flag code for special-case locales", () => { + expect(getFlagCodeForLocale("ja-JP")).toBe("JP"); + expect(getFlagCodeForLocale("zh-CN")).toBe("CN"); + expect(getFlagCodeForLocale("vi-VN")).toBe("VN"); + expect(getFlagCodeForLocale("ko-KR")).toBe("KR"); + expect(getFlagCodeForLocale("cs-CZ")).toBe("CZ"); + }); + + it("returns IE (Ireland) for Irish locale, not GA (Gabon)", () => { + expect(getFlagCodeForLocale("ga-IE")).toBe("IE"); + }); + + it("falls back to EN when no locale is provided", () => { + expect(getFlagCodeForLocale()).toBe("EN"); + expect(getFlagCodeForLocale(undefined)).toBe("EN"); + }); +});