I18n-module: Locale file not load when navigate from non-default to default language

Created on 14 Aug 2020  路  3Comments  路  Source: nuxt-community/i18n-module

Version

nuxt-i18n: 6.13.7
nuxt: 2.14.1

Nuxt configuration

mode:

  • [x] universal
  • [] spa

Nuxt-i18n configuration

i18n: {
    locales: [
      {
        code: "en",
        name: "EN",
        file: "en.json"
      },
      {
        code: "th",
        name: "TH",
        file: "th.json"
      }
    ],
    defaultLocale: "en",
    strategy: "prefix",
    lazy: true,
    langDir: "locales/",
    detectBrowserLanguage: false
  }

Reproduction Link

https://codesandbox.io/s/friendly-lamport-326c8

Steps to reproduce

  • Open the sandbox link
  • Start with /th link
  • Click 'en'
  • The locale for en is not loaded

What is Expected?

  • The locale for en should load

What is actually happening?

  • The locale for en is not loaded

Etc.

  • If you start with /en (the default locale) and click th, the locale is working properly
  • nuxt-i18n version 6.13.6 not having this issue
bug 馃悰

Most helpful comment

Released in v6.13.9

All 3 comments

Silly mistake, sorry about that.
It would have worked if you would set i18n.fallbackLocale to en also but maybe you don't want that and it shouldn't be necessary anyway.

Released in v6.13.9

It's working. Thank you for very quick fix @rchl !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vodnicearv picture vodnicearv  路  20Comments

pi0 picture pi0  路  18Comments

alexgrozav picture alexgrozav  路  21Comments

NadhirBoukhenifra picture NadhirBoukhenifra  路  30Comments

manniL picture manniL  路  24Comments