2022-04-08 13:48:36 +00:00
|
|
|
import { createRoot } from 'react-dom/client';
|
2020-10-29 16:05:28 +00:00
|
|
|
|
2019-10-21 19:04:30 +00:00
|
|
|
import App from './App';
|
2021-09-23 14:56:41 +00:00
|
|
|
import variables from 'modules/variables';
|
2019-09-29 16:46:53 +00:00
|
|
|
|
2020-08-26 13:32:52 +00:00
|
|
|
import './scss/index.scss';
|
2021-03-17 14:41:50 +00:00
|
|
|
// the toast css is based on default so we need to import it
|
2021-04-11 14:53:11 +00:00
|
|
|
import 'react-toastify/dist/ReactToastify.min.css';
|
2020-08-26 13:32:52 +00:00
|
|
|
|
2021-08-23 14:33:09 +00:00
|
|
|
// local stats
|
2021-08-28 14:34:12 +00:00
|
|
|
import Stats from 'modules/helpers/stats';
|
2021-06-21 16:42:14 +00:00
|
|
|
|
2021-03-19 22:30:29 +00:00
|
|
|
// language
|
2021-09-10 15:38:53 +00:00
|
|
|
import I18n from '@eartharoid/i18n';
|
2021-03-23 20:01:37 +00:00
|
|
|
const languagecode = localStorage.getItem('language') || 'en_GB';
|
2021-04-12 17:55:02 +00:00
|
|
|
|
2021-05-22 21:56:24 +00:00
|
|
|
// we set things to window. so we avoid passing the translation strings as props to each component
|
2021-09-10 15:38:53 +00:00
|
|
|
variables.languagecode = languagecode.replace('-', '_');
|
2021-04-12 17:55:02 +00:00
|
|
|
|
2021-04-16 18:09:56 +00:00
|
|
|
if (languagecode === 'en') {
|
2021-09-10 15:38:53 +00:00
|
|
|
variables.languagecode = 'en_GB';
|
2021-04-16 18:09:56 +00:00
|
|
|
}
|
|
|
|
|
2021-10-12 21:18:47 +00:00
|
|
|
variables.language = new I18n(variables.languagecode, {
|
2021-11-28 20:00:22 +00:00
|
|
|
de_DE: require('./translations/de_DE.json'),
|
2021-10-12 21:18:47 +00:00
|
|
|
en_GB: require('./translations/en_GB.json'),
|
|
|
|
en_US: require('./translations/en_US.json'),
|
|
|
|
es: require('./translations/es.json'),
|
|
|
|
fr: require('./translations/fr.json'),
|
|
|
|
nl: require('./translations/nl.json'),
|
|
|
|
no: require('./translations/no.json'),
|
|
|
|
ru: require('./translations/ru.json'),
|
2022-04-07 08:10:20 +00:00
|
|
|
zh_CN: require('./translations/zh_CN.json'),
|
2022-04-11 21:57:07 +00:00
|
|
|
id_ID: require('./translations/id_ID.json'),
|
2021-09-10 15:38:53 +00:00
|
|
|
});
|
2021-10-12 21:18:47 +00:00
|
|
|
|
|
|
|
// set html language tag
|
|
|
|
if (variables.languagecode !== 'en_GB' || variables.languagecode !== 'en_US') {
|
|
|
|
document.documentElement.lang = variables.languagecode.split('_')[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (localStorage.getItem('stats') === 'true') {
|
|
|
|
variables.stats = Stats;
|
|
|
|
}
|
|
|
|
|
2021-11-17 22:10:07 +00:00
|
|
|
/*if (localStorage.getItem('keybindsEnabled') === 'true') {
|
2021-10-12 21:18:47 +00:00
|
|
|
variables.keybinds = JSON.parse(localStorage.getItem('keybinds') || '{}');
|
2021-11-17 22:10:07 +00:00
|
|
|
}*/
|
2021-10-12 21:18:47 +00:00
|
|
|
|
2022-04-08 13:48:36 +00:00
|
|
|
const container = document.getElementById('root');
|
|
|
|
const root = createRoot(container);
|
|
|
|
|
2022-04-11 21:57:07 +00:00
|
|
|
root.render(<App />);
|