提交 cbb66532 编写于 作者: 雪洛's avatar 雪洛

fix: i18n fallback error

上级 d03a6416
...@@ -31,11 +31,15 @@ class UniID { ...@@ -31,11 +31,15 @@ class UniID {
if (uniIDConfig.hasFile('custom-token.js')) { if (uniIDConfig.hasFile('custom-token.js')) {
this.setInterceptor('customToken', require(uniIDConfig.resolve('custom-token.js'))) this.setInterceptor('customToken', require(uniIDConfig.resolve('custom-token.js')))
} }
const fallbackLocale = 'zh-Hans'
this._i18n = uniCloud.initI18n({ this._i18n = uniCloud.initI18n({
locale: this._clientInfo.locale, locale: this._clientInfo.locale,
fallbackLocale: 'zh-Hans', fallbackLocale,
messages messages: JSON.parse(JSON.stringify(messages))
}) })
if (!messages[this._i18n.locale]) {
this._i18n.setLocale(fallbackLocale)
}
} }
setInterceptor (timing, handler) { setInterceptor (timing, handler) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册