vue-i18n.ts 533 Bytes
Newer Older
hucy's avatar
hucy committed
1 2
import { boot } from 'quasar/wrappers';
import { createI18n } from 'vue-i18n';
hucy's avatar
hucy committed
3
import globalLang from 'src/i18n';
hucy's avatar
hucy committed
4 5 6 7 8 9 10

export default boot(({ app }) => {
  // Create I18n instance
  const i18n = createI18n({
    // something vue-i18n options here ...
    legacy: false, // you must set `false`, to use Composition API
    locale: 'zh-CN', // set current locale
hucy's avatar
hucy committed
11
    formatFallbackMessages: true,
hucy's avatar
hucy committed
12 13
    missingWarn: false,
    fallbackWarn: false,
hucy's avatar
hucy committed
14
    messages: globalLang,
hucy's avatar
hucy committed
15 16 17 18 19
  });

  // Tell app to use the I18n instance
  app.use(i18n);
});