Open jonasdlindner opened 3 years ago
Solved by using another function-name in src/i18nInit.js
import { addLocale, useLocale as localize} from 'ttag';
import * as cookie from './cookie';
const LOCALE_COOKIE = '__locale';
function getLocale() {
return cookie.get(LOCALE_COOKIE) || 'en';
}
export function saveLocale(locale) {
cookie.set(LOCALE_COOKIE, locale);
}
// setup
const locale = getLocale();
if (locale !== 'en') {
const translationsObj = require(`../i18n/${locale}.po.json`);
addLocale(locale, translationsObj);
localize(locale);
}
I tried the example with React Version "17.0.1" (Changed Version in package.json) and got the following error