diff --git a/src/lib/i18n.js b/src/lib/i18n.js index 958f47b..4134c3f 100644 --- a/src/lib/i18n.js +++ b/src/lib/i18n.js @@ -1,15 +1,21 @@ import { init, register, getLocaleFromNavigator } from 'svelte-i18n'; -register('en', () => import('./../locales/en.json')); // English -register('es', () => import('./../locales/es.json')); // Spanish -register('pl', () => import('./../locales/pl.json')); // Polish -register('vi', () => import('./../locales/vi.json')); // Vietnamese -register('tl', () => import('./../locales/tl.json')); // Tagalog -register('so', () => import('./../locales/so.json')); // Somali -register('am', () => import('./../locales/am.json')); // Amharic -register('ar', () => import('./../locales/ar.json')); // Arabic +async function setup() { + register('en', () => import('./../locales/en.json')); // English + register('es', () => import('./../locales/es.json')); // Spanish + register('pl', () => import('./../locales/pl.json')); // Polish + register('vi', () => import('./../locales/vi.json')); // Vietnamese + register('tl', () => import('./../locales/tl.json')); // Tagalog + register('so', () => import('./../locales/so.json')); // Somali + register('am', () => import('./../locales/am.json')); // Amharic + register('ar', () => import('./../locales/ar.json')); // Arabic -init({ - fallbackLocale: 'en', - initialLocale: getLocaleFromNavigator() -}); + return await Promise.allSettled([ + init({ + fallbackLocale: 'en', + initialLocale: getLocaleFromNavigator() + }) + ]); +} + +await setup();