aboutsummaryrefslogtreecommitdiffstats
path: root/src/i18n/translations.ts
blob: c62256aecfba822373980c823ffa7f3d52c6f27b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* eslint-disable global-require */
import { APP_LOCALES } from './languages';

export default function generatedTranslations() {
  const translations = [];
  for (const key of Object.keys(APP_LOCALES)) {
    try {
      // eslint-disable-next-line import/no-dynamic-require
      const translation = require(`./locales/${key}.json`);
      translations[key] = translation;
    } catch {
      console.warn(`Can't find translations for ${key}`);
    }
  }
  return translations;
}