From 5107268e5e305de786185792e895fb243c193d30 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Tue, 27 Jun 2023 13:54:22 +0530 Subject: [PATCH] Extracted string --- lib/generated/intl/messages_en.dart | 8 ++++++++ lib/generated/l10n.dart | 20 ++++++++++++++++++++ lib/l10n/intl_en.arb | 16 ++++++++++++++++ lib/ui/tools/deduplicate_page.dart | 15 +++++---------- 4 files changed, 49 insertions(+), 10 deletions(-) diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index b8e799177..c4fe7f752 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -53,6 +53,9 @@ class MessageLookup extends MessageLookupByLibrary { static String m10(provider) => "Please contact us at support@ente.io to manage your ${provider} subscription."; + static String m63(count) => + "{count, plural, Delete one{${count} item} other{${count} items}}"; + static String m11(currentlyDeleting, totalCount) => "Deleting ${currentlyDeleting} / ${totalCount}"; @@ -65,6 +68,9 @@ class MessageLookup extends MessageLookupByLibrary { static String m14(count, storageSaved) => "Your have cleaned up ${Intl.plural(count, one: '${count} duplicate file', other: '${count} duplicate files')}, saving (${storageSaved}!)"; + static String m64(count, formattedSize) => + "${count} files, ${formattedSize} each"; + static String m15(newEmail) => "Email changed to ${newEmail}"; static String m16(email) => @@ -480,6 +486,7 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Delete from device"), "deleteFromEnte": MessageLookupByLibrary.simpleMessage("Delete from ente"), + "deleteItemCount": m63, "deleteLocation": MessageLookupByLibrary.simpleMessage("Delete location"), "deletePhotos": MessageLookupByLibrary.simpleMessage("Delete photos"), @@ -537,6 +544,7 @@ class MessageLookup extends MessageLookupByLibrary { "downloading": MessageLookupByLibrary.simpleMessage("Downloading..."), "dropSupportEmail": m13, "duplicateFileCountWithStorageSaved": m14, + "duplicateItemsGroup": m64, "edit": MessageLookupByLibrary.simpleMessage("Edit"), "editLocationTagTitle": MessageLookupByLibrary.simpleMessage("Edit location"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 16b22ac9f..9e05b44da 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -2918,6 +2918,26 @@ class S { ); } + /// `{count, plural, Delete one{{count} item} other{{count} items}}` + String deleteItemCount(Object count) { + return Intl.message( + '{count, plural, Delete one{$count item} other{$count items}}', + name: 'deleteItemCount', + desc: '', + args: [count], + ); + } + + /// `{count} files, {formattedSize} each` + String duplicateItemsGroup(int count, String formattedSize) { + return Intl.message( + '$count files, $formattedSize each', + name: 'duplicateItemsGroup', + desc: 'Display the number of duplicate files and their size', + args: [count, formattedSize], + ); + } + /// `{count, plural, one{{count} year ago} other{{count} years ago}}` String yearsAgo(num count) { return Intl.plural( diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index d8b2168ab..a5e7349b3 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -418,6 +418,22 @@ "skip": "Skip", "updatingFolderSelection": "Updating folder selection...", "itemCount": "{count, plural, one{{count} item} other{{count} items}}", + "deleteItemCount": "{count, plural, Delete one{{count} item} other{{count} items}}", + "duplicateItemsGroup": "{count} files, {formattedSize} each", + "@duplicateItemsGroup" : { + "description": "Display the number of duplicate files and their size", + "type": "text", + "placeholders": { + "count": { + "example": "12", + "type": "int" + }, + "formattedSize": { + "example": "2.3 MB", + "type": "String" + } + } + }, "yearsAgo": "{count, plural, one{{count} year ago} other{{count} years ago}}", "backupSettings": "Backup settings", "backupOverMobileData": "Backup over mobile data", diff --git a/lib/ui/tools/deduplicate_page.dart b/lib/ui/tools/deduplicate_page.dart index 31cff80cc..d8d5e8a84 100644 --- a/lib/ui/tools/deduplicate_page.dart +++ b/lib/ui/tools/deduplicate_page.dart @@ -350,12 +350,7 @@ class _DeduplicatePageState extends State { } Widget _getDeleteButton() { - String text; - if (_selectedFiles.length == 1) { - text = "Delete 1 item"; - } else { - text = "Delete " + _selectedFiles.length.toString() + " items"; - } + final String text = S.of(context).deleteItemCount(_selectedFiles.length); int size = 0; for (final file in _selectedFiles) { size += _fileSizeMap[file.uploadedFileID]!; @@ -416,10 +411,10 @@ class _DeduplicatePageState extends State { Padding( padding: const EdgeInsets.fromLTRB(2, 4, 4, 12), child: Text( - duplicates.files.length.toString() + - " files, " + - formatBytes(duplicates.size) + - " each", + S.of(context).duplicateItemsGroup( + duplicates.files.length, + formatBytes(duplicates.size), + ), style: Theme.of(context).textTheme.titleSmall, ), ),