af1a5cc2f1
* Toolbar ARIA Labels * Ensure all tests use real translations All tests should import the 'test-utils' file which re-exports all of the @testing-library functions. It wraps render() in a react-i18next instance. It's important that the component being tested is the one returned from withTranslation(). Co-authored-by: ov <omar.verduga@gmail.com>
26 lines
530 B
JavaScript
26 lines
530 B
JavaScript
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
|
|
import translations from '../translations/locales/en-US/translations.json';
|
|
|
|
i18n
|
|
.use(initReactI18next)
|
|
.init({
|
|
lng: 'en-US',
|
|
fallbackLng: 'en-US',
|
|
|
|
// have a common namespace used around the full app
|
|
ns: ['translations'],
|
|
defaultNS: 'translations',
|
|
|
|
debug: false,
|
|
|
|
interpolation: {
|
|
escapeValue: false, // not needed for react!!
|
|
},
|
|
|
|
resources: { 'en-US': { translations } },
|
|
});
|
|
|
|
|
|
export default i18n;
|