| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- // import Cookies from 'js-cookie'
- // import VueI18n from 'vue-i18n'
- // import Vue from 'vue'
- // Vue.use(VueI18n)
- // export default ({ app, store }) => {
- // // const data = {}
- // // // console.log(this.$store.index.locale,'22');
- // // const locale = Cookies.get('hb_lang') || language.lang
- // // const readDir = ['zh_CN', 'en_US']
- // // for (let i = 0; i < readDir.length; i++) {
- // // data[readDir[i]] = Object.assign({}, require(`./${readDir[i]}.json`))
- // // }
- // // // Set i18n instance on app
- // // // This way we can use it in middleware and pages asyncData/fetch
- // // app.i18n = new VueI18n({
- // // locale,
- // // fallbackLocale: locale, // 语言环境中不存在相应massage键时回退到指定语言
- // // messages: data
- // // })
- // // console.log(Cookies.get('hb_lang'),'221');
- // app.i18n = new VueI18n({
- // locale: store.state.locale,
- // fallbackLocale: 'zh_CN',
- // messages: {
- // 'en_US': require('@/locales/en_US.json'),
- // 'zh_CN': require('@/locales/zh_CN.json')
- // }
- // })
- // app.i18n.path = (link) => {
- // // 如果是默认语言,就省略
- // if (app.i18n.locale === app.i18n.fallbackLocale) {
- // return `/${link}`
- // }
- // return `/${app.i18n.locale}/${link}`
- // }
- // }
- export default () => {
- return [
- 'en',
- 'zh'
- ]
- }
|