diff options
| author | secondl1ght <[email protected]> | 2022-08-24 19:51:31 -0400 |
|---|---|---|
| committer | secondl1ght <[email protected]> | 2022-08-24 19:51:31 -0400 |
| commit | 34e0dc45994621c4cc7f46e5a974a5236b021178 (patch) | |
| tree | 2e814b5c32d6c68b0b5de5a23378b31763f65f6f /src/lib | |
| parent | 47d5d5bc6cdcd39f8d5ad93d9f5d15d3403c6c21 (diff) | |
| download | coinos-ui-34e0dc45994621c4cc7f46e5a974a5236b021178.tar.gz coinos-ui-34e0dc45994621c4cc7f46e5a974a5236b021178.zip | |
remove duplicate elements and format
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/translations/index.js | 46 |
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); |
