Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale file not load when navigate from non-default to default language #843

Closed
1 task done
Bigdragon13th opened this issue Aug 14, 2020 · 3 comments · Fixed by #846
Closed
1 task done

Locale file not load when navigate from non-default to default language #843

Bigdragon13th opened this issue Aug 14, 2020 · 3 comments · Fixed by #846
Labels

Comments

@Bigdragon13th
Copy link

Version

nuxt-i18n: 6.13.7
nuxt: 2.14.1

Nuxt configuration

mode:

  • 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
@Bigdragon13th Bigdragon13th changed the title Locale file not loading when navigate from non-default language to default language Locale file not load when navigate from non-default language to default language Aug 14, 2020
@Bigdragon13th Bigdragon13th changed the title Locale file not load when navigate from non-default language to default language Locale file not load when navigate from non-default to default language Aug 14, 2020
@rchl
Copy link
Collaborator

rchl commented Aug 14, 2020

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.

rchl added a commit that referenced this issue Aug 14, 2020
Only triggered when i18n.fallbackLocale was not set.

Resolves #843
rchl added a commit that referenced this issue Aug 14, 2020
Only triggered when i18n.fallbackLocale was not set.

Resolves #843
rchl added a commit that referenced this issue Aug 14, 2020
Only triggered when i18n.fallbackLocale was not set.

Resolves #843
rchl added a commit that referenced this issue Aug 15, 2020
Only triggered when i18n.fallbackLocale was not set.

Resolves #843
@rchl rchl closed this as completed in #846 Aug 15, 2020
rchl added a commit that referenced this issue Aug 15, 2020
#846)

Only triggered when i18n.fallbackLocale was not set.

Resolves #843
@rchl
Copy link
Collaborator

rchl commented Aug 15, 2020

Released in v6.13.9

@Bigdragon13th
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants