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

fix: i18n error

上级 1514d027
...@@ -212,11 +212,16 @@ module.exports = { ...@@ -212,11 +212,16 @@ module.exports = {
} }
// 国际化 // 国际化
const messages = require('./lang/index')
const fallbackLocale = 'zh-Hans'
const i18n = uniCloud.initI18n({ const i18n = uniCloud.initI18n({
locale: clientInfo.locale, locale: clientInfo.locale,
fallbackLocale: 'zh-Hans', fallbackLocale,
messages: require('./lang/index') messages: JSON.parse(JSON.stringify(messages))
}) })
if (!messages[i18n.locale]) {
i18n.setLocale(fallbackLocale)
}
this.t = i18n.t.bind(i18n) this.t = i18n.t.bind(i18n)
this.response = {} this.response = {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册