We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
问题描述: 项目开启i18n,通过模块路径传入语言集,在A页面将中文切换成英文,跳到B页面,打印this.$i18n.locale为“en-US”,但是this.$t()获取的还是中文,同样的方式在B页面切换中英文,返回到A页面,A页面能正常显示
项目配置: new MpxWebpackPlugin({ i18n: { locale: 'zh-CN', messagesPath: path.resolve(__dirname, '../src/common/locales/i18n.js') } })
new MpxWebpackPlugin({ i18n: { locale: 'zh-CN', messagesPath: path.resolve(__dirname, '../src/common/locales/i18n.js') } })
// i18n module.exports = { 'zh-CN': { message: { hello: '{msg} 世界' }, welcome: { intro: '这是mpx框架提供的i18n能力演示用的小程序' } }, 'en-US': { message: { hello: '{msg} world' }, welcome: { intro: 'this is an example of using i18n with mpx framework' } } }
module.exports = { 'zh-CN': { message: { hello: '{msg} 世界' }, welcome: { intro: '这是mpx框架提供的i18n能力演示用的小程序' } }, 'en-US': { message: { hello: '{msg} world' }, welcome: { intro: 'this is an example of using i18n with mpx framework' } } }
// 使用 changeLang() { this.language = this.language === 'en-US' ? 'zh-CN' : 'en-US' mpx.i18n.locale = this.language },
changeLang() { this.language = this.language === 'en-US' ? 'zh-CN' : 'en-US' mpx.i18n.locale = this.language },
The text was updated successfully, but these errors were encountered:
在 @mpxjs/core@2.8.47、@mpxjs/webpack-plugin@2.8.47 版本以及最新版本 @mpxjs/core@2.8.53、@mpxjs/webpack-plugin@2.8.53 均未复现问题。
@mpxjs/core@2.8.47
@mpxjs/webpack-plugin@2.8.47
@mpxjs/core@2.8.53
@mpxjs/webpack-plugin@2.8.53
视项目情况来手动升级核心依赖包或通过脚手架创建新项目确保依赖包为最新。
Sorry, something went wrong.
No branches or pull requests
问题描述:
项目开启i18n,通过模块路径传入语言集,在A页面将中文切换成英文,跳到B页面,打印this.$i18n.locale为“en-US”,但是this.$t()获取的还是中文,同样的方式在B页面切换中英文,返回到A页面,A页面能正常显示
项目配置:
new MpxWebpackPlugin({ i18n: { locale: 'zh-CN', messagesPath: path.resolve(__dirname, '../src/common/locales/i18n.js') } })
// i18n
module.exports = { 'zh-CN': { message: { hello: '{msg} 世界' }, welcome: { intro: '这是mpx框架提供的i18n能力演示用的小程序' } }, 'en-US': { message: { hello: '{msg} world' }, welcome: { intro: 'this is an example of using i18n with mpx framework' } } }
// 使用
changeLang() { this.language = this.language === 'en-US' ? 'zh-CN' : 'en-US' mpx.i18n.locale = this.language },
The text was updated successfully, but these errors were encountered: