mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-03-11 17:25:32 +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/providers/l10n_providers.dart';
|
||||||
import 'package:mangayomi/utils/cached_network.dart';
|
import 'package:mangayomi/utils/cached_network.dart';
|
||||||
import 'package:mangayomi/utils/extensions/build_context_extensions.dart';
|
import 'package:mangayomi/utils/extensions/build_context_extensions.dart';
|
||||||
|
import 'package:mangayomi/utils/item_type_localization.dart';
|
||||||
import 'package:mangayomi/utils/language.dart';
|
import 'package:mangayomi/utils/language.dart';
|
||||||
|
|
||||||
class SourceListTile extends StatelessWidget {
|
class SourceListTile extends StatelessWidget {
|
||||||
|
|
@ -81,11 +82,7 @@ class SourceListTile extends StatelessWidget {
|
||||||
title: Text(
|
title: Text(
|
||||||
!isLocal
|
!isLocal
|
||||||
? source.name!
|
? source.name!
|
||||||
: "${context.l10n.local_source} ${source.itemType == ItemType.manga
|
: "${context.l10n.local_source} ${source.itemType.localized(context.l10n)}",
|
||||||
? context.l10n.manga
|
|
||||||
: source.itemType == ItemType.anime
|
|
||||||
? context.l10n.anime
|
|
||||||
: context.l10n.novel}",
|
|
||||||
),
|
),
|
||||||
trailing: SizedBox(
|
trailing: SizedBox(
|
||||||
width: 150,
|
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/modules/widgets/progress_center.dart';
|
||||||
import 'package:mangayomi/utils/extensions/string_extensions.dart';
|
import 'package:mangayomi/utils/extensions/string_extensions.dart';
|
||||||
import 'package:mangayomi/utils/global_style.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:path/path.dart' as p;
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
|
|
||||||
|
|
@ -1861,11 +1862,7 @@ class _LibraryScreenState extends ConsumerState<LibraryScreen>
|
||||||
: Row(
|
: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
widget.itemType == ItemType.manga
|
widget.itemType.localized(l10n),
|
||||||
? l10n.manga
|
|
||||||
: widget.itemType == ItemType.anime
|
|
||||||
? l10n.anime
|
|
||||||
: l10n.novel,
|
|
||||||
style: TextStyle(color: Theme.of(context).hintColor),
|
style: TextStyle(color: Theme.of(context).hintColor),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
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/gridview_widget.dart';
|
||||||
import 'package:mangayomi/modules/widgets/manga_image_card_widget.dart';
|
import 'package:mangayomi/modules/widgets/manga_image_card_widget.dart';
|
||||||
import 'package:mangayomi/utils/global_style.dart';
|
import 'package:mangayomi/utils/global_style.dart';
|
||||||
|
import 'package:mangayomi/utils/item_type_localization.dart';
|
||||||
import 'package:marquee/marquee.dart';
|
import 'package:marquee/marquee.dart';
|
||||||
import 'package:super_sliver_list/super_sliver_list.dart';
|
import 'package:super_sliver_list/super_sliver_list.dart';
|
||||||
|
|
||||||
|
|
@ -167,11 +168,7 @@ class _MangaHomeScreenState extends ConsumerState<MangaHomeScreen> {
|
||||||
Text(
|
Text(
|
||||||
!isLocal
|
!isLocal
|
||||||
? "${source.name}"
|
? "${source.name}"
|
||||||
: "${context.l10n.local_source} ${source.itemType == ItemType.manga
|
: "${context.l10n.local_source} ${source.itemType.localized(context.l10n)}",
|
||||||
? context.l10n.manga
|
|
||||||
: source.itemType == ItemType.anime
|
|
||||||
? context.l10n.anime
|
|
||||||
: context.l10n.novel}",
|
|
||||||
),
|
),
|
||||||
source.notes != null && source.notes!.isNotEmpty
|
source.notes != null && source.notes!.isNotEmpty
|
||||||
? SizedBox(
|
? SizedBox(
|
||||||
|
|
|
||||||
|
|
@ -70,12 +70,6 @@ class _StatisticsScreenState extends ConsumerState<StatisticsScreen>
|
||||||
final l10n = context.l10n;
|
final l10n = context.l10n;
|
||||||
final stats = ref.watch(getStatisticsProvider(itemType: itemType));
|
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) {
|
final chapterLabel = switch (itemType) {
|
||||||
ItemType.manga => l10n.chapters,
|
ItemType.manga => l10n.chapters,
|
||||||
ItemType.anime => l10n.episodes,
|
ItemType.anime => l10n.episodes,
|
||||||
|
|
@ -125,7 +119,7 @@ class _StatisticsScreenState extends ConsumerState<StatisticsScreen>
|
||||||
downloadedItems: downloadedItems,
|
downloadedItems: downloadedItems,
|
||||||
averageChapters: averageChapters.toDouble(),
|
averageChapters: averageChapters.toDouble(),
|
||||||
readPercentage: readPercentage.toDouble(),
|
readPercentage: readPercentage.toDouble(),
|
||||||
title: title,
|
title: itemType.localized(l10n),
|
||||||
context: context,
|
context: context,
|
||||||
unreadLabel: unreadLabel,
|
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/modules/tracker_library/tracker_section_screen.dart';
|
||||||
import 'package:mangayomi/providers/l10n_providers.dart';
|
import 'package:mangayomi/providers/l10n_providers.dart';
|
||||||
import 'package:mangayomi/utils/constant.dart';
|
import 'package:mangayomi/utils/constant.dart';
|
||||||
|
import 'package:mangayomi/utils/item_type_localization.dart';
|
||||||
import 'package:super_sliver_list/super_sliver_list.dart';
|
import 'package:super_sliver_list/super_sliver_list.dart';
|
||||||
|
|
||||||
enum TrackerProviders {
|
enum TrackerProviders {
|
||||||
|
|
@ -92,7 +93,7 @@ class _TrackerLibraryScreenState extends ConsumerState<TrackerLibraryScreen> {
|
||||||
(trackerProvider.syncId == TrackerProviders.simkl.syncId ||
|
(trackerProvider.syncId == TrackerProviders.simkl.syncId ||
|
||||||
trackerProvider.syncId == TrackerProviders.trakt.syncId)
|
trackerProvider.syncId == TrackerProviders.trakt.syncId)
|
||||||
? trackerProvider.name
|
? trackerProvider.name
|
||||||
: "${trackerProvider.name} | ${itemType == ItemType.anime ? l10n.anime : l10n.manga}",
|
: "${trackerProvider.name} | ${itemType.localized(l10n)}",
|
||||||
),
|
),
|
||||||
leading: !_isSearch ? null : Container(),
|
leading: !_isSearch ? null : Container(),
|
||||||
actions: [
|
actions: [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue