Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
@nuxtjs/i18n locales changing after refresh

I have an application where I try to put the language management but I face a difficulty. I'm on the latest version of @nuxtjs/i18n. When I change language, my URl changes, my labels change, everything is fine. When I refresh my page, however, the system reverts to the old language.

Here is my conf:

[
 '@nuxtjs/i18n',
       {
           locales,
           defaultLocale,
           lazy: true,
           langDir: 'locales/',
           vueI18n: {
               fallbackLocale: defaultLocale,
           },
       },
   ],
   ['~/.build/merge-and-compare-locales.js', { defaultLocale }],
export const locales = [
    {
        code: 'en',
        file: 'en.json',
    },
    {
        code: 'fr',
        file: 'fr.json',
    },
]

export const defaultLocale = 'fr'

What more do I need to do to make it keep the language before refresh?

I specify that I use this method to change the language:

changeLocale(code: string) {
    this.$i18n.setLocale(code)
},

Locally it works fine. On the other hand on any other environment it does not work, the refresh makes return to the default language

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!