feat: hot reload support for some widgets, css improvements on marketplace

Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
David Ralph
2021-04-12 18:55:02 +01:00
parent fbe6e040ea
commit b370de9ea3
17 changed files with 147 additions and 25 deletions

View File

@@ -13,11 +13,15 @@ import '@fontsource/roboto/cyrillic-400.css';
// language
import merge from '@material-ui/utils/deepmerge';
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.replace('-', '_');
// these are merged so if a string is untranslated it doesn't break mue
window.language = merge(require('./translations/en_GB.json'), require(`./translations/${window.languagecode}.json`));
// set html language tag
if (window.languagecode !== 'en_GB' || window.languagecode !== 'en_US') {
document.documentElement.lang = window.languagecode.split('_')[0];