Vue Nuxt I18n,消息属性在添加新属性或编辑现有属性时不会直接反映出来。

huangapple go评论52阅读模式
英文:

Vue Nuxt I18n , the message properties it's not reflect directly when add new one or edit exist property

问题

我有一个Nuxt项目,当我尝试添加或编辑消息属性时,它不会立即反映出来,我应该终止应用程序并重新运行它才能看到结果。我遵循了Nuxt文档并应用了每一步。

英文:

i have Nuxt project, when i try to add or edit message property it's not reflect direct, i should terminate the app and re-run it to see the results.

i followed the Nuxt Documentation and applied every single step

答案1

得分: 1

编辑你的 nuxt.config.js 模块,使其如下所示:

modules: [
  [
    "@nuxtjs/i18n",
    {
      locales: [{ code: "en", name: "en-US", file: "en.json" }],
      langDir: "locales/"
    }
  ],
]

假设你的字符串文件名为 en.json,并且它位于 locales/ 目录中,如 locales/en.json

英文:

Edit your nuxt.config.js modules to look like this

modules: [
  [
    "@nuxtjs/i18n",
    {
      locales: [{ code: "en", name: "en-US", file: "en.json" }],
      langDir: "locales/"
    }
  ],
]

assuming your strings file is called en.json and it's inside locales/ like locales/en.json

huangapple
  • 本文由 发表于 2023年2月6日 05:15:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/75355556.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定