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'.
This commit is contained in:
Pedro Renan 2026-04-25 16:10:44 +01:00
parent 88124507ea
commit 78dc3f59ec
1 changed files with 2 additions and 1 deletions

View File

@ -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({ const i18n = createI18n({
legacy: false, legacy: false,