refactor: language cleanup and css fix

Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
David Ralph
2021-03-19 22:30:29 +00:00
parent 025303a01a
commit 70756befa2
23 changed files with 158 additions and 152 deletions

View File

@@ -10,6 +10,13 @@ import 'react-toastify/dist/ReactToastify.css';
import '@fontsource/lexend-deca/latin-400.css';
import '@fontsource/roboto/cyrillic-400.css';
// language
import merge from './modules/helpers/merge';
const languagecode = localStorage.getItem('language') || 'en-GB';
// we set things to window. so they're global and we avoid passing the translation strings as props to each component
window.languagecode = languagecode;
window.language = merge(require('./translations/en-GB.json'), require(`./translations/${languagecode}.json`));
ReactDOM.render(
<App/>,
document.getElementById('root')