aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorsecondl1ght <[email protected]>2022-08-24 19:51:31 -0400
committersecondl1ght <[email protected]>2022-08-24 19:51:31 -0400
commitf6ff5156b66efbb51ba046e37de65b466585124a (patch)
tree6fed2233ad80097cd75a2a0340f199f2c564eef0 /src/lib
parent8f8f85983d2f4cb734ed15b33ebc140028711733 (diff)
downloadcoinos-ui-f6ff5156b66efbb51ba046e37de65b466585124a.tar.gz
coinos-ui-f6ff5156b66efbb51ba046e37de65b466585124a.zip
remove duplicate elements and format
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/translations/index.js46
1 files changed, 20 insertions, 26 deletions
diff --git a/src/lib/translations/index.js b/src/lib/translations/index.js
index dc03c0b6..2b1f2481 100644
--- a/src/lib/translations/index.js
+++ b/src/lib/translations/index.js
@@ -3,42 +3,36 @@ import lang from './lang.json';
// setup loaders & translations from lang.json data
function createLocaleLoader(localeCode) {
- return {
- locale: localeCode,
- key: '',
- loader: async () => (
- await import(`../../locales/${localeCode}.json`)
- ).default
- };
+ return {
+ locale: localeCode,
+ key: '',
+ loader: async () => (await import(`../../locales/${localeCode}.json`)).default
+ };
}
const availableLocales = Object.keys(lang);
const translations = {};
for (let i = 0; i < availableLocales.length; i++) {
- translations[availableLocales[i]] = { lang };
+ translations[availableLocales[i]] = { lang };
}
const loaders = availableLocales.map(createLocaleLoader);
const config = {
initLocale: 'en',
- fallbackLocale: 'en',
- translations: translations,
- loaders: [
- {
- locale: 'en',
- key: '',
- loader: async () => (
- await import("../../locales/en.json")
- ).default
- },
- {
- locale: 'fr',
- key: '',
- loader: async () => (
- await import("../../locales/fr.json")
- ).default
- }
- ]
+ fallbackLocale: 'en',
+ translations: translations,
+ 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);