Skip to content

Commit

Permalink
feat: localized strings
Browse files Browse the repository at this point in the history
  • Loading branch information
TesteurManiak committed Aug 10, 2023
1 parent ea0b623 commit 1d1f97a
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/features/details/widgets/details_bottom_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,23 @@ class DetailsBottomBar extends ConsumerWidget {
final hasUnread = ref.watch(
provider.select((s) => s.selectedChapters.any((e) => !e.read)),
);
final strings = context.strings;

return BottomAppBar(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (hasUnread)
IconButton(
tooltip: 'Mark as read'.hardcoded,
tooltip: strings.mark_as_read,
onPressed: () {
ref.read(provider.notifier).markSelectedChaptersAsRead();
},
icon: const Icon(Icons.done_all),
),
if (hasRead)
IconButton(
tooltip: 'Mark as unread'.hardcoded,
tooltip: strings.mark_as_unread,
onPressed: () {
ref.read(provider.notifier).markSelectedChaptersAsUnread();
},
Expand Down
2 changes: 1 addition & 1 deletion lib/features/search/widgets/source_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class _SearchFieldState extends ConsumerState<_SearchField> {
ref.read(filteredMangaProvider.notifier).startSearch(value.trim());
},
decoration: InputDecoration(
hintText: 'Recherche...'.hardcoded,
hintText: context.strings.generic_search,
suffixIcon: showClearButton
? IconButton(
icon: const Icon(Icons.clear),
Expand Down
18 changes: 18 additions & 0 deletions lib/gen/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ abstract class AppLocalizations {
/// **'Réessayer'**
String get generic_retry;

/// No description provided for @generic_search.
///
/// In fr, this message translates to:
/// **'Recherche...'**
String get generic_search;

/// No description provided for @details_add_to_library.
///
/// In fr, this message translates to:
Expand Down Expand Up @@ -356,6 +362,18 @@ abstract class AppLocalizations {
/// In fr, this message translates to:
/// **'Mode de lecture'**
String get lecture_mode;

/// No description provided for @mark_as_read.
///
/// In fr, this message translates to:
/// **'Marquer comme lu'**
String get mark_as_read;

/// No description provided for @mark_as_unread.
///
/// In fr, this message translates to:
/// **'Marquer comme non lu'**
String get mark_as_unread;
}

class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
Expand Down
9 changes: 9 additions & 0 deletions lib/gen/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get generic_retry => 'Retry';

@override
String get generic_search => 'Search...';

@override
String get details_add_to_library => 'Add to library';

Expand Down Expand Up @@ -146,4 +149,10 @@ class AppLocalizationsEn extends AppLocalizations {

@override
String get lecture_mode => 'Lecture mode';

@override
String get mark_as_read => 'Mark as read';

@override
String get mark_as_unread => 'Mark as unread';
}
9 changes: 9 additions & 0 deletions lib/gen/app_localizations_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get generic_retry => 'Réessayer';

@override
String get generic_search => 'Recherche...';

@override
String get details_add_to_library => 'Ajouter à la bibliothèque';

Expand Down Expand Up @@ -146,4 +149,10 @@ class AppLocalizationsFr extends AppLocalizations {

@override
String get lecture_mode => 'Mode de lecture';

@override
String get mark_as_read => 'Marquer comme lu';

@override
String get mark_as_unread => 'Marquer comme non lu';
}
5 changes: 4 additions & 1 deletion lib/l10n/arb/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"generic_error": "Something went wrong",
"generic_cancel": "Cancel",
"generic_retry": "Retry",
"generic_search": "Search...",
"details_add_to_library": "Add to library",
"details_webview": "WebView",
"details_chapter_count": "{count, plural, =0{{count} chapter} =1{{count} chapter} other{{count} chapters}}",
Expand All @@ -50,5 +51,7 @@
"chapter_not_found": "Chapter not found",
"manga_not_found": "Manga not found",
"chapter_settings_for_this_series": "For this series",
"lecture_mode": "Lecture mode"
"lecture_mode": "Lecture mode",
"mark_as_read": "Mark as read",
"mark_as_unread": "Mark as unread"
}
5 changes: 4 additions & 1 deletion lib/l10n/arb/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"generic_error": "Une erreur est survenue",
"generic_cancel": "Annuler",
"generic_retry": "Réessayer",
"generic_search": "Recherche...",
"details_add_to_library": "Ajouter à la bibliothèque",
"details_webview": "WebView",
"details_chapter_count": "{count, plural, =0{{count} chapitre} =1{{count} chapitre} other{{count} chapitres}}",
Expand All @@ -50,5 +51,7 @@
"chapter_not_found": "Le chapitre n'a pas été trouvé",
"manga_not_found": "Le manga n'a pas été trouvé",
"chapter_settings_for_this_series": "Pour cette série",
"lecture_mode": "Mode de lecture"
"lecture_mode": "Mode de lecture",
"mark_as_read": "Marquer comme lu",
"mark_as_unread": "Marquer comme non lu"
}

0 comments on commit 1d1f97a

Please sign in to comment.