diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-09-14 19:58:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 19:58:52 +0200 |
commit | 95df3522a15631abc51a4295cae0ea401a8d4e1e (patch) | |
tree | e5eb0f368c947683f01458e912f21756fb0d99cb /src/i18n/translations.js | |
parent | docs: add sad270 as a contributor for bug, userTesting [skip ci] (#1941) (diff) | |
download | ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.gz ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.zst ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.zip |
feat: add eslint-plugin-unicorn (#1936)
Diffstat (limited to 'src/i18n/translations.js')
-rw-r--r-- | src/i18n/translations.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/i18n/translations.js b/src/i18n/translations.js index 161a172ba..9a7dc7453 100644 --- a/src/i18n/translations.js +++ b/src/i18n/translations.js | |||
@@ -1,13 +1,15 @@ | |||
1 | /* eslint-disable global-require */ | ||
1 | import { APP_LOCALES } from './languages'; | 2 | import { APP_LOCALES } from './languages'; |
2 | 3 | ||
3 | const translations = []; | 4 | const translations = []; |
4 | Object.keys(APP_LOCALES).forEach((key) => { | 5 | for (const key of Object.keys(APP_LOCALES)) { |
5 | try { | 6 | try { |
6 | const translation = require(`./locales/${key}.json`); // eslint-disable-line | 7 | // eslint-disable-next-line import/no-dynamic-require |
8 | const translation = require(`./locales/${key}.json`); | ||
7 | translations[key] = translation; | 9 | translations[key] = translation; |
8 | } catch (err) { | 10 | } catch { |
9 | console.warn(`Can't find translations for ${key}`); | 11 | console.warn(`Can't find translations for ${key}`); |
10 | } | 12 | } |
11 | }); | 13 | } |
12 | 14 | ||
13 | module.exports = translations; | 15 | module.exports = translations; |