mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-01-11 22:40:36 +00:00
Use the localized extension
This commit is contained in:
parent
9efd76581f
commit
1ac605e30a
5 changed files with 9 additions and 23 deletions
|
|
@ -8,6 +8,7 @@ import 'package:mangayomi/models/source.dart';
|
|||
import 'package:mangayomi/providers/l10n_providers.dart';
|
||||
import 'package:mangayomi/utils/cached_network.dart';
|
||||
import 'package:mangayomi/utils/extensions/build_context_extensions.dart';
|
||||
import 'package:mangayomi/utils/item_type_localization.dart';
|
||||
import 'package:mangayomi/utils/language.dart';
|
||||
|
||||
class SourceListTile extends StatelessWidget {
|
||||
|
|
@ -81,11 +82,7 @@ class SourceListTile extends StatelessWidget {
|
|||
title: Text(
|
||||
!isLocal
|
||||
? source.name!
|
||||
: "${context.l10n.local_source} ${source.itemType == ItemType.manga
|
||||
? context.l10n.manga
|
||||
: source.itemType == ItemType.anime
|
||||
? context.l10n.anime
|
||||
: context.l10n.novel}",
|
||||
: "${context.l10n.local_source} ${source.itemType.localized(context.l10n)}",
|
||||
),
|
||||
trailing: SizedBox(
|
||||
width: 150,
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import 'package:mangayomi/modules/widgets/error_text.dart';
|
|||
import 'package:mangayomi/modules/widgets/progress_center.dart';
|
||||
import 'package:mangayomi/utils/extensions/string_extensions.dart';
|
||||
import 'package:mangayomi/utils/global_style.dart';
|
||||
import 'package:mangayomi/utils/item_type_localization.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
|
|
@ -1861,11 +1862,7 @@ class _LibraryScreenState extends ConsumerState<LibraryScreen>
|
|||
: Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.itemType == ItemType.manga
|
||||
? l10n.manga
|
||||
: widget.itemType == ItemType.anime
|
||||
? l10n.anime
|
||||
: l10n.novel,
|
||||
widget.itemType.localized(l10n),
|
||||
style: TextStyle(color: Theme.of(context).hintColor),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import 'package:mangayomi/modules/manga/home/widget/mangas_card_selector.dart';
|
|||
import 'package:mangayomi/modules/widgets/gridview_widget.dart';
|
||||
import 'package:mangayomi/modules/widgets/manga_image_card_widget.dart';
|
||||
import 'package:mangayomi/utils/global_style.dart';
|
||||
import 'package:mangayomi/utils/item_type_localization.dart';
|
||||
import 'package:marquee/marquee.dart';
|
||||
import 'package:super_sliver_list/super_sliver_list.dart';
|
||||
|
||||
|
|
@ -167,11 +168,7 @@ class _MangaHomeScreenState extends ConsumerState<MangaHomeScreen> {
|
|||
Text(
|
||||
!isLocal
|
||||
? "${source.name}"
|
||||
: "${context.l10n.local_source} ${source.itemType == ItemType.manga
|
||||
? context.l10n.manga
|
||||
: source.itemType == ItemType.anime
|
||||
? context.l10n.anime
|
||||
: context.l10n.novel}",
|
||||
: "${context.l10n.local_source} ${source.itemType.localized(context.l10n)}",
|
||||
),
|
||||
source.notes != null && source.notes!.isNotEmpty
|
||||
? SizedBox(
|
||||
|
|
|
|||
|
|
@ -70,12 +70,6 @@ class _StatisticsScreenState extends ConsumerState<StatisticsScreen>
|
|||
final l10n = context.l10n;
|
||||
final stats = ref.watch(getStatisticsProvider(itemType: itemType));
|
||||
|
||||
final title = switch (itemType) {
|
||||
ItemType.manga => l10n.manga,
|
||||
ItemType.anime => l10n.anime,
|
||||
_ => l10n.novel,
|
||||
};
|
||||
|
||||
final chapterLabel = switch (itemType) {
|
||||
ItemType.manga => l10n.chapters,
|
||||
ItemType.anime => l10n.episodes,
|
||||
|
|
@ -125,7 +119,7 @@ class _StatisticsScreenState extends ConsumerState<StatisticsScreen>
|
|||
downloadedItems: downloadedItems,
|
||||
averageChapters: averageChapters.toDouble(),
|
||||
readPercentage: readPercentage.toDouble(),
|
||||
title: title,
|
||||
title: itemType.localized(l10n),
|
||||
context: context,
|
||||
unreadLabel: unreadLabel,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import 'package:mangayomi/modules/tracker_library/tracker_library_section.dart';
|
|||
import 'package:mangayomi/modules/tracker_library/tracker_section_screen.dart';
|
||||
import 'package:mangayomi/providers/l10n_providers.dart';
|
||||
import 'package:mangayomi/utils/constant.dart';
|
||||
import 'package:mangayomi/utils/item_type_localization.dart';
|
||||
import 'package:super_sliver_list/super_sliver_list.dart';
|
||||
|
||||
enum TrackerProviders {
|
||||
|
|
@ -92,7 +93,7 @@ class _TrackerLibraryScreenState extends ConsumerState<TrackerLibraryScreen> {
|
|||
(trackerProvider.syncId == TrackerProviders.simkl.syncId ||
|
||||
trackerProvider.syncId == TrackerProviders.trakt.syncId)
|
||||
? trackerProvider.name
|
||||
: "${trackerProvider.name} | ${itemType == ItemType.anime ? l10n.anime : l10n.manga}",
|
||||
: "${trackerProvider.name} | ${itemType.localized(l10n)}",
|
||||
),
|
||||
leading: !_isSearch ? null : Container(),
|
||||
actions: [
|
||||
|
|
|
|||
Loading…
Reference in a new issue