p5.js-web-editor/client/i18n-test.js
Andrew Nicolaou af1a5cc2f1
Use translations for all tests (#1568)
* 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>
2020-08-26 14:19:34 +02:00

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;