[vue-i18n] Fall back to translate the keypath 'depo.method' with 'en-US' locale.
- Vorherrschende Sprache
- Vue
- Sterne
- 17.5k
- Forks
- 3.6k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
[vue-i18n] Fall back to translate the keypath 'depo.method' with 'en-US' locale.
locale zh-CN

const i18n = new VueI18n({
locale: cookie.get('lang'),
messages: {
'zh-CN': require('./common/lang/cn'), // 中文语言包
'en-US': require('./common/lang/en') // 英文语言包
}
})
mounted () {
if (cookie.get('lang') === '0') {
this.locale = 'en-US'
this.lang = '中文'
} else {
this.locale = 'zh-CN'
this.lang = 'ENG'
}
cookie.set('lang', this.locale === 'en-US' ? '0' : '1', 1)
},
watch: {
locale (val) {
this.$i18n.locale = val
console.log('locale', val)
}
},

本地有cookie, 为1,函数是 lang=1的时候,locale是中文,但是它还是返回到用英文。
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start by reproducing the shown VueI18n configuration with the cookie values 0 and 1, the zh-CN/en-US messages, and the `depo.method` keypath. Inspect the mounted hook and locale watcher to determine why zh-CN still resolves through en-US. Done means the selected locale consistently resolves the intended translation without unintended fallback.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- frontend, internationalization
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100