From 78dc3f59ecdfbe4be8f5c17687b3373d68f46f12 Mon Sep 17 00:00:00 2001 From: Pedro Renan Date: Sat, 25 Apr 2026 16:10:44 +0100 Subject: [PATCH] fix(i18n): migrate legacy 'pt' locale key to 'pt-br' Users who previously selected Portuguese have 'pt' stored in localStorage. Without this guard, they would silently fall back to Chinese after the 'pt' key was replaced by 'pt-br'/'pt-pt'. --- frontend/src/i18n/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/i18n/index.js b/frontend/src/i18n/index.js index aa265535..b2fa60e1 100644 --- a/frontend/src/i18n/index.js +++ b/frontend/src/i18n/index.js @@ -14,7 +14,8 @@ for (const path in localeFiles) { } } -const savedLocale = localStorage.getItem('locale') || 'zh' +let savedLocale = localStorage.getItem('locale') || 'zh' +if (savedLocale === 'pt') savedLocale = 'pt-br' const i18n = createI18n({ legacy: false,