Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

194
Vistas
@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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda