From 79641c4850d85b54e23e7bcc18f6963a54a01c90 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Fri, 7 Apr 2023 11:27:56 +0530 Subject: [PATCH] l10n: extract strings --- lib/generated/intl/messages_en.dart | 15 +++++ lib/generated/l10n.dart | 90 ++++++++++++++++++++++++++++ lib/l10n/intl_en.arb | 11 +++- lib/ui/tools/deduplicate_page.dart | 21 +++---- lib/ui/viewer/file/video_widget.dart | 3 +- 5 files changed, 128 insertions(+), 12 deletions(-) diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 522d9192e..8ea0ee3d0 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -294,6 +294,8 @@ class MessageLookup extends MessageLookupByLibrary { "clickOnTheOverflowMenu": MessageLookupByLibrary.simpleMessage( "• Click on the overflow menu"), "close": MessageLookupByLibrary.simpleMessage("Close"), + "clubByCaptureTime": + MessageLookupByLibrary.simpleMessage("Club by capture time"), "codeAppliedPageTitle": MessageLookupByLibrary.simpleMessage("Code applied"), "codeCopiedToClipboard": @@ -345,6 +347,7 @@ class MessageLookup extends MessageLookupByLibrary { "We could not backup your data.\nWe will retry later."), "couldNotUpdateSubscription": MessageLookupByLibrary.simpleMessage( "Could not update subscription"), + "count": MessageLookupByLibrary.simpleMessage("Count"), "createAccount": MessageLookupByLibrary.simpleMessage("Create account"), "createAlbumActionHint": MessageLookupByLibrary.simpleMessage( "Long press to select photos and click + to create an album"), @@ -363,6 +366,10 @@ class MessageLookup extends MessageLookupByLibrary { "custom": MessageLookupByLibrary.simpleMessage("Custom"), "darkTheme": MessageLookupByLibrary.simpleMessage("Dark"), "decrypting": MessageLookupByLibrary.simpleMessage("Decrypting..."), + "decryptingVideo": + MessageLookupByLibrary.simpleMessage("Decrypting video..."), + "deduplicateFiles": + MessageLookupByLibrary.simpleMessage("Deduplicate Files"), "delete": MessageLookupByLibrary.simpleMessage("Delete"), "deleteAccount": MessageLookupByLibrary.simpleMessage("Delete account"), "deleteAccountFeedbackPrompt": MessageLookupByLibrary.simpleMessage( @@ -407,6 +414,7 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Delete shared album?"), "deleteSharedAlbumDialogBody": MessageLookupByLibrary.simpleMessage( "The album will be deleted for everyone\n\nYou will lose access to shared photos in this album that are owned by others"), + "deselectAll": MessageLookupByLibrary.simpleMessage("Deselect all"), "designedToOutlive": MessageLookupByLibrary.simpleMessage("Designed to outlive"), "details": MessageLookupByLibrary.simpleMessage("Details"), @@ -587,6 +595,9 @@ class MessageLookup extends MessageLookupByLibrary { "logInLabel": MessageLookupByLibrary.simpleMessage("Log in"), "loggingOut": MessageLookupByLibrary.simpleMessage("Logging out..."), "logout": MessageLookupByLibrary.simpleMessage("Logout"), + "longpressOnAnItemToViewInFullscreen": + MessageLookupByLibrary.simpleMessage( + "Long-press on an item to view in full-screen"), "lostDevice": MessageLookupByLibrary.simpleMessage("Lost device?"), "manage": MessageLookupByLibrary.simpleMessage("Manage"), "manageDeviceStorage": @@ -783,6 +794,8 @@ class MessageLookup extends MessageLookupByLibrary { "restoringFiles": MessageLookupByLibrary.simpleMessage("Restoring files..."), "retry": MessageLookupByLibrary.simpleMessage("Retry"), + "reviewDeduplicateItems": MessageLookupByLibrary.simpleMessage( + "Please review and delete the items you believe are duplicates."), "safelyStored": MessageLookupByLibrary.simpleMessage("Safely stored"), "saveKey": MessageLookupByLibrary.simpleMessage("Save key"), "saveYourRecoveryKeyIfYouHaventAlready": @@ -924,9 +937,11 @@ class MessageLookup extends MessageLookupByLibrary { "This will log you out of the following device:"), "thisWillLogYouOutOfThisDevice": MessageLookupByLibrary.simpleMessage( "This will log you out of this device!"), + "time": MessageLookupByLibrary.simpleMessage("Time"), "toHideAPhotoOrVideo": MessageLookupByLibrary.simpleMessage("To hide a photo or video"), "total": MessageLookupByLibrary.simpleMessage("total"), + "totalSize": MessageLookupByLibrary.simpleMessage("Total size"), "trash": MessageLookupByLibrary.simpleMessage("Trash"), "tryAgain": MessageLookupByLibrary.simpleMessage("Try again"), "turnOnBackupForAutoUpload": MessageLookupByLibrary.simpleMessage( diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 43a3029cd..dbb2569ff 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -5677,6 +5677,96 @@ class S { args: [], ); } + + /// `Deduplicate Files` + String get deduplicateFiles { + return Intl.message( + 'Deduplicate Files', + name: 'deduplicateFiles', + desc: '', + args: [], + ); + } + + /// `Deselect all` + String get deselectAll { + return Intl.message( + 'Deselect all', + name: 'deselectAll', + desc: '', + args: [], + ); + } + + /// `Please review and delete the items you believe are duplicates.` + String get reviewDeduplicateItems { + return Intl.message( + 'Please review and delete the items you believe are duplicates.', + name: 'reviewDeduplicateItems', + desc: '', + args: [], + ); + } + + /// `Club by capture time` + String get clubByCaptureTime { + return Intl.message( + 'Club by capture time', + name: 'clubByCaptureTime', + desc: '', + args: [], + ); + } + + /// `Count` + String get count { + return Intl.message( + 'Count', + name: 'count', + desc: '', + args: [], + ); + } + + /// `Total size` + String get totalSize { + return Intl.message( + 'Total size', + name: 'totalSize', + desc: '', + args: [], + ); + } + + /// `Time` + String get time { + return Intl.message( + 'Time', + name: 'time', + desc: '', + args: [], + ); + } + + /// `Long-press on an item to view in full-screen` + String get longpressOnAnItemToViewInFullscreen { + return Intl.message( + 'Long-press on an item to view in full-screen', + name: 'longpressOnAnItemToViewInFullscreen', + desc: '', + args: [], + ); + } + + /// `Decrypting video...` + String get decryptingVideo { + return Intl.message( + 'Decrypting video...', + name: 'decryptingVideo', + desc: '', + args: [], + ); + } } class AppLocalizationDelegate extends LocalizationsDelegate { diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 4f194d692..45a2f3c89 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -787,5 +787,14 @@ "fileSavedToGallery": "File saved to gallery", "download": "Download", "pressAndHoldToPlayVideo": "Press and hold to play video", - "downloadFailed": "Download failed" + "downloadFailed": "Download failed", + "deduplicateFiles": "Deduplicate Files", + "deselectAll": "Deselect all", + "reviewDeduplicateItems": "Please review and delete the items you believe are duplicates.", + "clubByCaptureTime": "Club by capture time", + "count": "Count", + "totalSize": "Total size", + "time": "Time", + "longpressOnAnItemToViewInFullscreen": "Long-press on an item to view in full-screen", + "decryptingVideo": "Decrypting video..." } diff --git a/lib/ui/tools/deduplicate_page.dart b/lib/ui/tools/deduplicate_page.dart index 83c2ccf9b..49e010d92 100644 --- a/lib/ui/tools/deduplicate_page.dart +++ b/lib/ui/tools/deduplicate_page.dart @@ -4,6 +4,7 @@ import 'package:photos/core/constants.dart'; import 'package:photos/core/event_bus.dart'; import 'package:photos/ente_theme_data.dart'; import 'package:photos/events/user_details_changed_event.dart'; +import "package:photos/generated/l10n.dart"; import 'package:photos/models/duplicate_files.dart'; import 'package:photos/models/file.dart'; import 'package:photos/services/collections_service.dart'; @@ -57,7 +58,7 @@ class _DeduplicatePageState extends State { _duplicates = DeduplicationService.instance.clubDuplicatesByTime(widget.duplicates); _selectAllFilesButFirst(); - showToast(context, "Long-press on an item to view in full-screen"); + showShortToast(context, S.of(context).longpressOnAnItemToViewInFullscreen); } void _selectAllFilesButFirst() { @@ -80,7 +81,7 @@ class _DeduplicatePageState extends State { return Scaffold( appBar: AppBar( elevation: 0, - title: const Text("Deduplicate Files"), + title: Text(S.of(context).deduplicateFiles), actions: [ PopupMenuButton( constraints: const BoxConstraints(minWidth: 180), @@ -109,7 +110,7 @@ class _DeduplicatePageState extends State { Padding( padding: const EdgeInsets.only(bottom: 1), child: Text( - "Deselect all", + S.of(context).deselectAll, style: Theme.of(context) .textTheme .subtitle1! @@ -156,7 +157,7 @@ class _DeduplicatePageState extends State { return _getClubbingConfig(); } else if (index == 2) { if (_duplicates.isNotEmpty) { - return _getSortMenu(); + return _getSortMenu(context); } else { return const Padding( padding: EdgeInsets.only(top: 32), @@ -203,7 +204,7 @@ class _DeduplicatePageState extends State { padding: EdgeInsets.all(2), ), Text( - "Please review and delete the items you believe are duplicates.", + S.of(context).reviewDeduplicateItems, style: Theme.of(context).textTheme.subtitle2, ), const Padding( @@ -227,7 +228,7 @@ class _DeduplicatePageState extends State { _resetEntriesAndSelection(); setState(() {}); }, - title: const Text("Club by capture time"), + title: Text(S.of(context).clubByCaptureTime), ), ); } @@ -242,18 +243,18 @@ class _DeduplicatePageState extends State { _selectAllFilesButFirst(); } - Widget _getSortMenu() { + Widget _getSortMenu(BuildContext context) { Text sortOptionText(SortKey key) { String text = key.toString(); switch (key) { case SortKey.count: - text = "Count"; + text = S.of(context).count; break; case SortKey.size: - text = "Total size"; + text = S.of(context).totalSize; break; case SortKey.time: - text = "Time"; + text = S.of(context).time; break; } return Text( diff --git a/lib/ui/viewer/file/video_widget.dart b/lib/ui/viewer/file/video_widget.dart index 41f8a7c43..35d146981 100644 --- a/lib/ui/viewer/file/video_widget.dart +++ b/lib/ui/viewer/file/video_widget.dart @@ -7,6 +7,7 @@ import 'package:flutter/material.dart'; import 'package:logging/logging.dart'; import 'package:photos/core/configuration.dart'; import 'package:photos/core/constants.dart'; +import "package:photos/generated/l10n.dart"; import 'package:photos/models/file.dart'; import 'package:photos/services/files_service.dart'; import 'package:photos/ui/viewer/file/thumbnail_widget.dart'; @@ -94,7 +95,7 @@ class _VideoWidgetState extends State { setState(() { _progress = count / (widget.file.fileSize ?? total); if (_progress == 1) { - showShortToast(context, "Decrypting video..."); + showShortToast(context, S.of(context).decryptingVideo); } }); }