Files
kopyl.dev.v2/src/lib/translations.ts
2024-09-28 00:18:35 +03:00

35 lines
519 B
TypeScript

import i18n from 'sveltekit-i18n';
export const defaultLocale = 'en';
const config = ({
loaders: [
{
locale: 'en',
key: '',
loader: async () => (
await import('./en.json')
).default,
},
{
locale: 'ru',
key: '',
loader: async () => (
await import('./ru.json')
).default,
}
],
});
export const {
t,
locale,
locales,
loading,
loadTranslations,
setLocale,
translations,
addTranslations,
setRoute
} = new i18n(config);