【问题标题】:Vue3 - i18n - You are running the esm-bundler build of vue-i18nVue3 - i18n - 您正在运行 vue-i18n 的 esm-bundler 构建
【发布时间】:2021-05-30 22:24:26
【问题描述】:

我刚刚用 Vue3 开始了一个新项目并添加了vue-i18n 版本 9 (https://vue-i18n.intlify.dev/guide/) 我已经设置了,但我无法更改语言。它正在进行翻译,因为它将{{ $t('message.value') }} 更改为正确的句子。 我无法更改语言,仅适用于区域设置语言。

我在浏览器控制台中收到此错误消息

You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.

这是我的配置,但我无法将其更改为西班牙语

const i18n = VueI18n.createI18n({
  locale: 'en', // set locale
  fallbackLocale: 'en', // set fallback locale
  messages, // set locale messages

})

如果你能帮助我,告诉我我做错了什么,我将不胜感激。 非常感谢

【问题讨论】:

  • 它工作正常并更改了语言,但很高兴知道如何处理警告。

标签: vue.js vuejs3 i18next vue-i18n


【解决方案1】:

在生产模式下运行您的应用时不应该看到它。

在开发中运行时,它已在版本 v2.0.1 中得到纠正

【讨论】:

    猜你喜欢
    • 2023-04-09
    • 1970-01-01
    • 2022-06-20
    • 2021-10-06
    • 1970-01-01
    • 2023-04-02
    • 1970-01-01
    • 2021-06-01
    • 1970-01-01
    相关资源
    最近更新 更多