diff --git a/src/components/MigrationCard.tsx b/src/components/MigrationCard.tsx index 8400f76e..2c610b85 100644 --- a/src/components/MigrationCard.tsx +++ b/src/components/MigrationCard.tsx @@ -14,6 +14,7 @@ import Chip from '@mui/material/Chip'; import Avatar from '@mui/material/Avatar'; import Typography from '@mui/material/Typography'; import { Link } from 'react-router-dom'; +import { useTranslation } from 'react-i18next'; import { requestManager } from '@/lib/requests/RequestManager.ts'; import { GetMigratableSourcesQuery } from '@/lib/graphql/generated/graphql.ts'; import { translateExtensionLanguage } from '@/screens/util/Extensions.ts'; @@ -24,51 +25,58 @@ export type TMigratableSource = NonNullable ( - - - - - - - - - - {name} - - { + const { t } = useTranslation(); + + const isLocalSource = Number(id) === 0; + const sourceName = isLocalSource ? t('source.local_source.title') : name; + + return ( + + + + + - {translateExtensionLanguage(lang)} - + + + + + {sourceName} + + + {translateExtensionLanguage(lang)} + + - - - - - -); + + + + + ); +}; diff --git a/src/components/SourceCard.tsx b/src/components/SourceCard.tsx index 75939ff3..72c80ea1 100644 --- a/src/components/SourceCard.tsx +++ b/src/components/SourceCard.tsx @@ -47,6 +47,9 @@ export const SourceCard: React.FC = (props: IProps) => { showSourceRepo, } = props; + const isLocalSource = Number(id) === 0; + const sourceName = isLocalSource ? t('source.local_source.title') : name; + return ( = (props: IProps) => { = (props: IProps) => { @@ -94,39 +97,37 @@ export const SourceCard: React.FC = (props: IProps) => { }} > - {name} + {sourceName} + + + {translateExtensionLanguage(lang)} + {isNsfw && ( + + {' 18+'} + + )} + {showSourceRepo && ( + + {repo} + + )} - {id !== '0' && ( - - {translateExtensionLanguage(lang)} - {isNsfw && ( - - {' 18+'} - - )} - {showSourceRepo && ( - - {repo} - - )} - - )} diff --git a/src/components/manga/MangaDetails.tsx b/src/components/manga/MangaDetails.tsx index 92a55ebc..ab51c846 100644 --- a/src/components/manga/MangaDetails.tsx +++ b/src/components/manga/MangaDetails.tsx @@ -119,6 +119,11 @@ function getSourceName(source?: Pick | null): return translate('global.label.unknown'); } + const isLocalSource = Number(source.id) === 0; + if (isLocalSource) { + return translate('source.local_source.title'); + } + return source.displayName ?? source.id; }