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:
parent
88124507ea
commit
78dc3f59ec
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue