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:
schroda
2023-03-23 13:59:32 +01:00
committed by GitHub
parent 8c129f2e08
commit d58bd6cd92
56 changed files with 1030 additions and 416 deletions

View File

@@ -21,6 +21,7 @@ import {
import CategorySelect from 'components/navbar/action/CategorySelect';
import React, { useState } from 'react';
import { IManga } from 'typings';
import { useTranslation } from 'react-i18next';
interface IProps {
manga: IManga;
@@ -29,6 +30,7 @@ interface IProps {
}
const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => {
const { t } = useTranslation();
const theme = useTheme();
const isLargeScreen = useMediaQuery(theme.breakpoints.up('sm'));
@@ -44,7 +46,7 @@ const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => {
<>
{isLargeScreen && (
<>
<Tooltip title="Reload data from source">
<Tooltip title={t('manga.label.reload_from_source')}>
<IconButton
onClick={() => {
onRefresh();
@@ -55,7 +57,7 @@ const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => {
</IconButton>
</Tooltip>
{manga.inLibrary && (
<Tooltip title="Edit manga categories">
<Tooltip title={t('manga.label.edit_categories')}>
<IconButton
onClick={() => {
setEditCategories(true);
@@ -97,7 +99,7 @@ const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => {
<ListItemIcon>
<Refresh fontSize="small" />
</ListItemIcon>
<ListItemText>Reload data from source</ListItemText>
<ListItemText>{t('manga.label.reload_from_source')}</ListItemText>
</MenuItem>
{manga.inLibrary && (
<MenuItem
@@ -109,7 +111,7 @@ const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => {
<ListItemIcon>
<Label fontSize="small" />
</ListItemIcon>
<ListItemText>Edit manga categories</ListItemText>
<ListItemText>{t('manga.label.edit_categories')}</ListItemText>
</MenuItem>
)}
</Menu>