Begin translation and finish i18n system
This commit is contained in:
@@ -3,7 +3,6 @@ import lang from './lang.json';
|
||||
|
||||
/** @type {import('sveltekit-i18n').Config} */
|
||||
const config = {
|
||||
defaultLocale: 'en',
|
||||
fallbackLocale: 'en',
|
||||
translations: {
|
||||
en: { lang },
|
||||
@@ -13,16 +12,16 @@ const config = {
|
||||
{
|
||||
locale: 'en',
|
||||
key: '',
|
||||
loader: async () => (await import('../../static/locales/en.json')).default
|
||||
loader: async () => (await import('./locales/en.json')).default
|
||||
},
|
||||
{
|
||||
locale: 'fr',
|
||||
key: '',
|
||||
loader: async () => (await import('../../static/locales/fr.json')).default
|
||||
loader: async () => (await import('./locales/fr.json')).default
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export const { t, locale, locales, loading, loadTranslations } = new i18n(config);
|
||||
export const { t, loading, locales, locale, loadTranslations } = new i18n(config);
|
||||
|
||||
loading.subscribe(($loading) => $loading && console.log('Loading translations...'));
|
||||
loading.subscribe(($loading) => $loading);
|
||||
|
||||
Reference in New Issue
Block a user