You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
923 B

import type { TranslationStore } from './i18n-types';
import type { AppSchema } from "@/libs/olds/i18n/schema.ts";
import { createI18n } from './i18n.ts';
/**
* 1. IDIOMAS SOPORTADOS
*/
export type SupportedLocales = 'es' | 'en';
/**
* 2. TRADUCCIONES INICIALES (CORE)
* Solo incluimos lo mínimo indispensable para que la app arranque.
*/
const initialTranslations: Partial<TranslationStore<AppSchema, SupportedLocales>> = {
es: {
core: {
error : "Ha ocurrido un error inesperado",
loading: "Cargando..."
}
},
en: {
core: {
error : "An unexpected error occurred",
loading: "Loading..."
}
}
};
/**
* 4. INSTANCIA EXPORTABLE
*/
export const i18n = createI18n<AppSchema, SupportedLocales>(
initialTranslations,
'es'
);
// Helper para exportar directamente la función de traducción
export const t = i18n.t;

Powered by TurnKey Linux.