fix: sidebar bug, tab name translation

This commit is contained in:
David Ralph
2022-05-23 20:44:49 +01:00
parent 4f29d376ca
commit 2c89894372
6 changed files with 41 additions and 26 deletions

View File

@@ -43,6 +43,7 @@
border: none;
background: none;
min-width: calc(100% - 1.2em);
text-align: left;
&:hover {
background: t($modal-sidebarActive);

View File

@@ -9,6 +9,7 @@ import {
} from '@mui/material';
import EventBus from 'modules/helpers/eventbus';
import translations from 'modules/translations';
export default class Radio extends PureComponent {
constructor(props) {
@@ -18,7 +19,7 @@ export default class Radio extends PureComponent {
};
}
handleChange = (e) => {
handleChange = async (e) => {
const { value } = e.target;
if (value === 'loading') {
@@ -31,10 +32,9 @@ export default class Radio extends PureComponent {
localStorage.getItem('tabName') ===
variables.language.getMessage(variables.languagecode, 'tabname')
) {
// todo: fix this it doesn't work and shows as undefined
localStorage.setItem(
'tabName',
import(`../../../../translations/${value.replace('-', '_')}.json`).tabname,
translations[value.replace('-', '_')].tabname,
);
}
}

View File

@@ -15,7 +15,6 @@ import Tooltip from '../../helpers/tooltip/Tooltip';
import Modal from 'react-modal';
import ShareModal from '../../helpers/sharemodal/ShareModal';
//import Hotkeys from 'react-hot-keys';
import { toast } from 'react-toastify';
const toDataURL = async (url) => {
const res = await fetch(url);