- Update default lng from 'es' to 'en' - Update fallbackLng from 'es' to 'en' - Application will now display in English by default - Users can still switch to Spanish via language selector https://claude.ai/code/session_01GNbnkFoESkRcnPr3bLCYDg
22 lines
552 B
TypeScript
22 lines
552 B
TypeScript
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import es from './locales/es.json';
|
|
import en from './locales/en.json';
|
|
|
|
// Configuración de i18next
|
|
i18n
|
|
.use(initReactI18next)
|
|
.init({
|
|
resources: {
|
|
es: { translation: es },
|
|
en: { translation: en },
|
|
},
|
|
lng: localStorage.getItem('language') || 'en', // English by default
|
|
fallbackLng: 'en', // If translation fails, use English
|
|
interpolation: {
|
|
escapeValue: false, // React ya escapa por defecto
|
|
},
|
|
});
|
|
|
|
export default i18n;
|