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:
@@ -7,6 +7,7 @@ import Typography from '@mui/material/Typography';
|
||||
import client from 'util/client';
|
||||
import makeToast from 'components/util/Toast';
|
||||
import { IUpdateStatus } from 'typings';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface IProgressProps {
|
||||
progress: number;
|
||||
@@ -30,6 +31,8 @@ interface IUpdateCheckerProps {
|
||||
}
|
||||
|
||||
function UpdateChecker({ handleFinishedUpdate }: IUpdateCheckerProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [progress, setProgress] = useState(0);
|
||||
|
||||
@@ -39,7 +42,7 @@ function UpdateChecker({ handleFinishedUpdate }: IUpdateCheckerProps) {
|
||||
setProgress(0);
|
||||
await client.post('/api/v1/update/fetch');
|
||||
} catch (e) {
|
||||
makeToast('Checking for updates failed!', 'error');
|
||||
makeToast(t('global.error.label.update_failed'), 'error');
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user