aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/translations/index.js
diff options
context:
space:
mode:
authorAdrien Hopkins <[email protected]>2022-08-23 10:43:30 -0500
committerAdrien Hopkins <[email protected]>2022-08-23 10:43:30 -0500
commit9cd989d4435690f6ec1d0a063c45610b78f05069 (patch)
tree49d93889c322846df2e87d8d7a5e3a4f0ecced4e /src/lib/translations/index.js
parentc7ee4f41c5fe8b5664c82e65bc4aa7948dc7b510 (diff)
downloadcoinos-ui-9cd989d4435690f6ec1d0a063c45610b78f05069.tar.gz
coinos-ui-9cd989d4435690f6ec1d0a063c45610b78f05069.zip
fixed broken translations & use json locales instead of JS
Diffstat (limited to 'src/lib/translations/index.js')
-rw-r--r--src/lib/translations/index.js23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/lib/translations/index.js b/src/lib/translations/index.js
index 023da884..6ed83689 100644
--- a/src/lib/translations/index.js
+++ b/src/lib/translations/index.js
@@ -1,9 +1,28 @@
import i18n from 'sveltekit-i18n';
-import translations from './translations';
+import lang from './lang.json';
const config = {
initLocale: 'en',
- translations
+ translations: {
+ en: { lang },
+ fr: { lang }
+ },
+ loaders: [
+ {
+ locale: 'en',
+ key: '',
+ loader: async () => (
+ await import("../../locales/en.json")
+ ).default
+ },
+ {
+ locale: 'fr',
+ key: '',
+ loader: async () => (
+ await import("../../locales/fr.json")
+ ).default
+ }
+ ]
};
export const { t, l, locales, locale } = new i18n(config);