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

201
Vistas
Why does i18next work with some languages ​and not with others?

I'm using i18next and when i call the changeLanguage function with the languages 'es' or 'en' it seems to work perfectly, but when i call it when another language 'de' 'fr' 'it' or whatever, it doesn't works and it goes to the fallbackLng. It's kind of weird because with two languages works perfect, but the other three languages doesn't works

This is my i18n.ts file

import i18n from 'i18next';

import { initReactI18next } from 'react-i18next';

const frenchTranslatorObject = require('../assets/locales/fr.json');
const spanishTranslatorObject = require('../assets/locales/es.json');
const englishTranslationObject = require('../assets/locales/en.json');
const germanTranslationObject = require('../assets/locales/gr.json');
const portugeseTranslationObject = require('../assets/locales/pt.json');
const italianishTranslationObject = require('../assets/locales/it.json');

export default i18n.use(initReactI18next).init({
    resources: {
        es: {
            translation: {
                'landing.main.title': 'en SPANISH',
            },
        },
        en: {
            translation: {
                'landing.main.title': 'EN ENGLISH',
            },
        },
        fr: {
            translations: {
                'landing.main.title': 'en FRANCES',
            },
        },
        de: {
            translations: {
                'landing.main.title': 'EN ALEMANNNN',
            },
        },
        it: {
            translations: {
                'landing.main.title': 'EN ITALIANO',
            },
        },
        pt: {
            translations: {
                'landing.main.title': 'EN PORTUGUES',
            },
        },
    },
    lng: 'es',
    fallbackLng: ['en', 'es', 'fr'],
    compatibilityJSON: 'v3',
    interpolation: {
        escapeValue: false,
        format: function (value, format, lng) {
            if (value && format === 'uppercase') {
                return value.toUpperCase();
            } else if (value && format === 'lowercase') {
                return value.toLowerCase();
            } else if (value && format === 'capitalize') {
                return value.charAt(0).toUpperCase() + value.slice(1);
            }

            return value;
        },
    },
});

i18n.on('languageChanged', (lng) => {
    console.info('callback log that triggers when language change', lng);
});

and I call the function like this: i18n.changeLanguage('de');

If anyone sees any errors that can tell me, I will be grateful

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