-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[vue] 你有使用过vue开发多语言项目吗?说说你的做法? #559
New issue
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
Comments
什么是多语言项目? |
国际化?i18n |
我个人网站的多语言是用vuex实现的,所有语言对于信息都命名,存在后端,由restful接口返回,在切换语言时触发dispatch,调用接口,在所有页面里mapState拿到语言配置,渲染上去 i18n没耍过 |
vue-i18n 使用简单,案例也多,很方便 |
开发过,用的i18n,比较不错, |
i18n,重要是初始化时,判断当前语言环境,要想好存储方案。一般存在localStorage就行了。 |
采用i18n来解决国际化问题,关于语言环境的存储方案,看到有同学解答localStorage的方式,个人认为这种还是采用Cookie的存储方法,通过路由实现不同模块加载不同的国际化配置文件 |
使用Vue-i18n 加载不同的语言配置文件 |
Vue I18n 是 Vue.js 的国际化插件。它可以轻松地将一些本地化功能集成到你的 Vue.js 应用程序中。 |
多语言适配(i18n)与使用哪种前端框架无关。 本质上是维护一个 map,然后通过一个中间层返回当前语种的显示内容。 这个 map 可以存储在 DB,通过 HTTP 接口获取; 当前语种可以由用户选择存储在本地; |
使用vue-i18n,或者自己写一套多语言的编译方案 |
[vue] 你有使用过vue开发多语言项目吗?说说你的做法?
The text was updated successfully, but these errors were encountered: