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
威爱通需要支持 zh-CN, en-US, zh-TW 三种语言,具体的需求是:
'编译'过程中引入语言包,直接生成不同语种的 bundle.js 文件,由于启用了静态资源(hash)缓存策略, 该方案无法满足用户自由切换语言的需求。
运行过程中引入语言包,用户切换语言时,通过 reload,重新注入切换后的语言包。
see https://www.w3.org/International/techniques/authoring-html.en?open=style
lang
The text was updated successfully, but these errors were encountered:
16slowly
No branches or pull requests
背景
威爱通需要支持 zh-CN, en-US, zh-TW 三种语言,具体的需求是:
I18n 难点
实现思路
准备资源
实现策略
1. webpack I18nWebpackPlugin
'编译'过程中引入语言包,直接生成不同语种的 bundle.js 文件,由于启用了静态资源(hash)缓存策略, 该方案无法满足用户自由切换语言的需求。
2. react-intl
运行过程中引入语言包,用户切换语言时,通过 reload,重新注入切换后的语言包。
3. 样式处理
see https://www.w3.org/International/techniques/authoring-html.en?open=style
lang
, 不方便维护.4. 针对不同语言分别建站,适用于大型应用。
参阅
The text was updated successfully, but these errors were encountered: