blob: 9b23497e150227f5782bd24bf4f5631c6f0d8f53 (
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 const 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;
};
|