add translation keys (#246)
* Fix i18n tsc issue "t" can return null by default. This was already disabled in the config, but it had no effect on tsc. * Fix translation in "DefaultNavBar" key was missing and since this is a constant the translation wouldn't update in case the language got changed after first load. * Enable typing for i18n translation keys * Add translation keys
This commit is contained in:
@@ -17,6 +17,7 @@ import Radio from '@mui/material/Radio';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
import Button from '@mui/material/Button';
|
||||
import { ListPreferenceProps } from 'typings';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface IListDialogProps {
|
||||
value: string;
|
||||
@@ -27,6 +28,8 @@ interface IListDialogProps {
|
||||
}
|
||||
|
||||
function ListDialog(props: IListDialogProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { value: valueProp, open, onClose, options, title } = props;
|
||||
const [value, setValue] = React.useState(valueProp);
|
||||
const radioGroupRef = React.useRef<HTMLDivElement>(null);
|
||||
@@ -72,9 +75,9 @@ function ListDialog(props: IListDialogProps) {
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button autoFocus onClick={handleCancel}>
|
||||
Cancel
|
||||
{t('global.button.cancel')}
|
||||
</Button>
|
||||
<Button onClick={handleOk}>Ok</Button>
|
||||
<Button onClick={handleOk}>{t('global.button.ok')}</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user