diff options
Diffstat (limited to 'src/i18n/translations.ts')
-rw-r--r-- | src/i18n/translations.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/i18n/translations.ts b/src/i18n/translations.ts new file mode 100644 index 000000000..9a7dc7453 --- /dev/null +++ b/src/i18n/translations.ts | |||
@@ -0,0 +1,15 @@ | |||
1 | /* eslint-disable global-require */ | ||
2 | import { APP_LOCALES } from './languages'; | ||
3 | |||
4 | const translations = []; | ||
5 | for (const key of Object.keys(APP_LOCALES)) { | ||
6 | try { | ||
7 | // eslint-disable-next-line import/no-dynamic-require | ||
8 | const translation = require(`./locales/${key}.json`); | ||
9 | translations[key] = translation; | ||
10 | } catch { | ||
11 | console.warn(`Can't find translations for ${key}`); | ||
12 | } | ||
13 | } | ||
14 | |||
15 | module.exports = translations; | ||