2021-12-28 11:56:23 +01:00
|
|
|
import { I18nProvider } from '@react-aria/i18n'
|
2018-07-12 10:09:41 +02:00
|
|
|
import { render } from 'react-dom'
|
2021-03-23 10:09:10 +01:00
|
|
|
import App from './App'
|
2021-01-18 14:34:27 +01:00
|
|
|
import i18next from './locales/i18n'
|
|
|
|
import ruleTranslations from './locales/rules-en.yaml'
|
|
|
|
import translateRules from './locales/translateRules'
|
2021-03-23 10:09:10 +01:00
|
|
|
import translations from './locales/ui-en.yaml'
|
2022-04-13 18:42:50 +02:00
|
|
|
import { withProfiler } from '@sentry/react'
|
2021-05-03 13:28:31 +02:00
|
|
|
import './sentry'
|
2018-08-28 15:59:41 +02:00
|
|
|
|
2021-12-29 18:21:02 +01:00
|
|
|
export const AppEn = () => (
|
2021-11-30 16:09:05 +01:00
|
|
|
<I18nProvider locale="en-GB">
|
2021-12-27 12:46:40 +01:00
|
|
|
<App
|
|
|
|
basename="infrance"
|
2022-01-04 11:11:31 +01:00
|
|
|
rulesPreTransform={(rules) =>
|
|
|
|
translateRules('en', ruleTranslations, rules)
|
|
|
|
}
|
2021-12-27 12:46:40 +01:00
|
|
|
/>
|
2021-12-28 11:56:23 +01:00
|
|
|
</I18nProvider>
|
2021-11-30 16:09:05 +01:00
|
|
|
)
|
2021-12-28 11:56:23 +01:00
|
|
|
|
2022-04-13 18:42:50 +02:00
|
|
|
const AppEnWithProfiler = withProfiler(AppEn)
|
|
|
|
|
2021-12-29 18:21:02 +01:00
|
|
|
i18next.addResourceBundle('en', 'translation', translations)
|
|
|
|
|
|
|
|
if (!import.meta.env.SSR) {
|
2022-03-28 15:34:12 +02:00
|
|
|
i18next.changeLanguage('en').catch((err) =>
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.error(err)
|
|
|
|
)
|
2022-04-13 18:42:50 +02:00
|
|
|
render(<AppEnWithProfiler />, document.querySelector('#js'))
|
2021-12-29 18:21:02 +01:00
|
|
|
}
|