Neeraj Gupta пре 2 година
родитељ
комит
372469f9ce

+ 26 - 1
lib/generated/intl/messages_en.dart

@@ -369,6 +369,7 @@ class MessageLookup extends MessageLookupByLibrary {
             " other albums they are part of?"),
         "deleteAlbumsDialogBody": MessageLookupByLibrary.simpleMessage(
             "This will delete all empty albums. This is useful when you want to reduce the clutter in your album list."),
+        "deleteAll": MessageLookupByLibrary.simpleMessage("Delete All"),
         "deleteConfirmDialogBody": MessageLookupByLibrary.simpleMessage(
             "You are about to permanently delete your account and all its data.\nThis action is irreversible."),
         "deleteEmptyAlbums":
@@ -402,6 +403,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "details": MessageLookupByLibrary.simpleMessage("Details"),
         "devAccountChanged": MessageLookupByLibrary.simpleMessage(
             "The developer account we use to publish ente on App Store has changed. Because of this, you will need to login again.\n\nOur apologies for the inconvenience, but this was unavoidable."),
+        "deviceFilesAutoUploading": MessageLookupByLibrary.simpleMessage(
+            "Files added to this device album will automatically get uploaded to ente."),
         "deviceLockExplanation": MessageLookupByLibrary.simpleMessage(
             "Disable the device screen lock when ente is in the foreground and there is a backup in progress. This is normally not needed, but may help big uploads and initial imports of large libraries complete faster."),
         "disableAutoLock":
@@ -509,6 +512,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "howItWorks": MessageLookupByLibrary.simpleMessage("How it works"),
         "howToViewShareeVerificationID": MessageLookupByLibrary.simpleMessage(
             "Please ask them to long-press their email address on the settings screen, and verify that the IDs on both devices match."),
+        "ignoredFolderUploadReason": MessageLookupByLibrary.simpleMessage(
+            "Some files in this album are ignored from upload because they had previously been deleted from ente."),
         "importing": MessageLookupByLibrary.simpleMessage("Importing...."),
         "incorrectPasswordTitle":
             MessageLookupByLibrary.simpleMessage("Incorrect password"),
@@ -531,6 +536,9 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Invite your friends"),
         "itemCount": m14,
         "itemSelectedCount": m15,
+        "itemsShowTheNumberOfDaysRemainingBeforePermanentDeletion":
+            MessageLookupByLibrary.simpleMessage(
+                "Items show the number of days remaining before permanent deletion"),
         "itemsWillBeRemovedFromAlbum": MessageLookupByLibrary.simpleMessage(
             "Selected items will be removed from this album"),
         "keepPhotos": MessageLookupByLibrary.simpleMessage("Keep Photos"),
@@ -538,7 +546,10 @@ class MessageLookup extends MessageLookupByLibrary {
             "Kindly help us with this information"),
         "lastUpdated": MessageLookupByLibrary.simpleMessage("Last updated"),
         "leave": MessageLookupByLibrary.simpleMessage("Leave"),
+        "leaveAlbum": MessageLookupByLibrary.simpleMessage("Leave album"),
         "leaveFamily": MessageLookupByLibrary.simpleMessage("Leave family"),
+        "leaveSharedAlbum":
+            MessageLookupByLibrary.simpleMessage("Leave shared album?"),
         "lightTheme": MessageLookupByLibrary.simpleMessage("Light"),
         "linkCopiedToClipboard":
             MessageLookupByLibrary.simpleMessage("Link copied to clipboard"),
@@ -626,6 +637,9 @@ class MessageLookup extends MessageLookupByLibrary {
         "photoGridSize":
             MessageLookupByLibrary.simpleMessage("Photo grid size"),
         "photoSmallCase": MessageLookupByLibrary.simpleMessage("photo"),
+        "photosAddedByYouWillBeRemovedFromTheAlbum":
+            MessageLookupByLibrary.simpleMessage(
+                "Photos added by you will be removed from the album"),
         "playstoreSubscription":
             MessageLookupByLibrary.simpleMessage("PlayStore subscription"),
         "pleaseContactSupportAndWeWillBeHappyToHelp":
@@ -719,12 +733,16 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Remove?"),
         "removingFromFavorites":
             MessageLookupByLibrary.simpleMessage("Removing from favorites..."),
+        "rename": MessageLookupByLibrary.simpleMessage("Rename"),
+        "renameAlbum": MessageLookupByLibrary.simpleMessage("Rename album"),
         "renewSubscription":
             MessageLookupByLibrary.simpleMessage("Renew subscription"),
         "renewsOn": m27,
         "reportABug": MessageLookupByLibrary.simpleMessage("Report a bug"),
         "reportBug": MessageLookupByLibrary.simpleMessage("Report bug"),
         "resendEmail": MessageLookupByLibrary.simpleMessage("Resend email"),
+        "resetIgnoredFiles":
+            MessageLookupByLibrary.simpleMessage("Reset ignored files"),
         "resetPasswordTitle":
             MessageLookupByLibrary.simpleMessage("Reset password"),
         "restore": MessageLookupByLibrary.simpleMessage("Restore"),
@@ -870,6 +888,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "total": MessageLookupByLibrary.simpleMessage("total"),
         "trash": MessageLookupByLibrary.simpleMessage("Trash"),
         "tryAgain": MessageLookupByLibrary.simpleMessage("Try again"),
+        "turnOnBackupForAutoUpload": MessageLookupByLibrary.simpleMessage(
+            "Turn on backup to automatically upload files added to this device folder to ente."),
         "twitter": MessageLookupByLibrary.simpleMessage("Twitter"),
         "twoMonthsFreeOnYearlyPlans": MessageLookupByLibrary.simpleMessage(
             "2 months free on yearly plans"),
@@ -948,6 +968,8 @@ class MessageLookup extends MessageLookupByLibrary {
             "You cannot downgrade to this plan"),
         "youCannotShareWithYourself": MessageLookupByLibrary.simpleMessage(
             "You cannot share with yourself"),
+        "youDontHaveAnyArchivedItems": MessageLookupByLibrary.simpleMessage(
+            "You don\'t have any archived items."),
         "youHaveSuccessfullyFreedUp": m45,
         "yourAccountHasBeenDeleted": MessageLookupByLibrary.simpleMessage(
             "Your account has been deleted"),
@@ -968,6 +990,9 @@ class MessageLookup extends MessageLookupByLibrary {
                 "Your subscription was updated successfully"),
         "youveNoDuplicateFilesThatCanBeCleared":
             MessageLookupByLibrary.simpleMessage(
-                "You\'ve no duplicate files that can be cleared")
+                "You\'ve no duplicate files that can be cleared"),
+        "youveNoFilesInThisAlbumThatCanBeDeleted":
+            MessageLookupByLibrary.simpleMessage(
+                "You\'ve no files in this album that can be deleted")
       };
 }

+ 130 - 0
lib/generated/l10n.dart

@@ -5256,6 +5256,136 @@ class S {
       args: [],
     );
   }
+
+  /// `Items show the number of days remaining before permanent deletion`
+  String get itemsShowTheNumberOfDaysRemainingBeforePermanentDeletion {
+    return Intl.message(
+      'Items show the number of days remaining before permanent deletion',
+      name: 'itemsShowTheNumberOfDaysRemainingBeforePermanentDeletion',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Delete All`
+  String get deleteAll {
+    return Intl.message(
+      'Delete All',
+      name: 'deleteAll',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Rename album`
+  String get renameAlbum {
+    return Intl.message(
+      'Rename album',
+      name: 'renameAlbum',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Rename`
+  String get rename {
+    return Intl.message(
+      'Rename',
+      name: 'rename',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Leave shared album?`
+  String get leaveSharedAlbum {
+    return Intl.message(
+      'Leave shared album?',
+      name: 'leaveSharedAlbum',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Leave album`
+  String get leaveAlbum {
+    return Intl.message(
+      'Leave album',
+      name: 'leaveAlbum',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Photos added by you will be removed from the album`
+  String get photosAddedByYouWillBeRemovedFromTheAlbum {
+    return Intl.message(
+      'Photos added by you will be removed from the album',
+      name: 'photosAddedByYouWillBeRemovedFromTheAlbum',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `You've no files in this album that can be deleted`
+  String get youveNoFilesInThisAlbumThatCanBeDeleted {
+    return Intl.message(
+      'You\'ve no files in this album that can be deleted',
+      name: 'youveNoFilesInThisAlbumThatCanBeDeleted',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `You don't have any archived items.`
+  String get youDontHaveAnyArchivedItems {
+    return Intl.message(
+      'You don\'t have any archived items.',
+      name: 'youDontHaveAnyArchivedItems',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Some files in this album are ignored from upload because they had previously been deleted from ente.`
+  String get ignoredFolderUploadReason {
+    return Intl.message(
+      'Some files in this album are ignored from upload because they had previously been deleted from ente.',
+      name: 'ignoredFolderUploadReason',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Reset ignored files`
+  String get resetIgnoredFiles {
+    return Intl.message(
+      'Reset ignored files',
+      name: 'resetIgnoredFiles',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Files added to this device album will automatically get uploaded to ente.`
+  String get deviceFilesAutoUploading {
+    return Intl.message(
+      'Files added to this device album will automatically get uploaded to ente.',
+      name: 'deviceFilesAutoUploading',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Turn on backup to automatically upload files added to this device folder to ente.`
+  String get turnOnBackupForAutoUpload {
+    return Intl.message(
+      'Turn on backup to automatically upload files added to this device folder to ente.',
+      name: 'turnOnBackupForAutoUpload',
+      desc: '',
+      args: [],
+    );
+  }
 }
 
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {

+ 14 - 1
lib/l10n/intl_en.arb

@@ -741,5 +741,18 @@
   "sharedByMe": "Shared by me",
   "doubleYourStorage": "Double your storage",
   "referFriendsAnd2xYourPlan": "Refer friends and 2x your plan",
-  "shareAlbumHint": "Open an album and tap the share button on the top right to share."
+  "shareAlbumHint": "Open an album and tap the share button on the top right to share.",
+  "itemsShowTheNumberOfDaysRemainingBeforePermanentDeletion": "Items show the number of days remaining before permanent deletion",
+  "deleteAll": "Delete All",
+  "renameAlbum": "Rename album",
+  "rename": "Rename",
+  "leaveSharedAlbum": "Leave shared album?",
+  "leaveAlbum": "Leave album",
+  "photosAddedByYouWillBeRemovedFromTheAlbum": "Photos added by you will be removed from the album",
+  "youveNoFilesInThisAlbumThatCanBeDeleted": "You've no files in this album that can be deleted",
+  "youDontHaveAnyArchivedItems": "You don't have any archived items.",
+  "ignoredFolderUploadReason": "Some files in this album are ignored from upload because they had previously been deleted from ente.",
+  "resetIgnoredFiles": "Reset ignored files",
+  "deviceFilesAutoUploading": "Files added to this device album will automatically get uploaded to ente.",
+  "turnOnBackupForAutoUpload": "Turn on backup to automatically upload files added to this device folder to ente."
 }

+ 5 - 4
lib/ui/viewer/gallery/archive_page.dart

@@ -4,6 +4,7 @@ import 'package:photos/core/configuration.dart';
 import 'package:photos/core/event_bus.dart';
 import 'package:photos/db/files_db.dart';
 import 'package:photos/events/files_updated_event.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/models/gallery_type.dart';
 import 'package:photos/models/magic_metadata.dart';
 import 'package:photos/models/selected_files.dart';
@@ -28,7 +29,7 @@ class ArchivePage extends StatelessWidget {
   }) : super(key: key);
 
   @override
-  Widget build(Object context) {
+  Widget build(BuildContext context) {
     final Set<int> hiddenCollectionIDs =
         CollectionsService.instance.getHiddenCollections();
     final gallery = Gallery(
@@ -63,8 +64,8 @@ class ArchivePage extends StatelessWidget {
       tagPrefix: tagPrefix,
       selectedFiles: _selectedFiles,
       initialFiles: null,
-      emptyState: const EmptyState(
-        text: "You don't have any archived items.",
+      emptyState: EmptyState(
+        text: S.of(context).youDontHaveAnyArchivedItems,
       ),
       header: Padding(
         padding: const EdgeInsets.only(bottom: 24, top: 8),
@@ -78,7 +79,7 @@ class ArchivePage extends StatelessWidget {
         preferredSize: const Size.fromHeight(50.0),
         child: GalleryAppBarWidget(
           appBarType,
-          "Archive",
+          S.of(context).archive,
           _selectedFiles,
         ),
       ),

+ 9 - 8
lib/ui/viewer/gallery/device_folder_page.dart

@@ -7,6 +7,7 @@ import 'package:photos/db/device_files_db.dart';
 import 'package:photos/db/files_db.dart';
 import 'package:photos/events/files_updated_event.dart';
 import 'package:photos/events/local_photos_updated_event.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/models/device_collection.dart';
 import 'package:photos/models/file.dart';
 import 'package:photos/models/gallery_type.dart';
@@ -112,7 +113,8 @@ class _BackupHeaderWidgetState extends State<BackupHeaderWidget> {
             mainAxisSize: MainAxisSize.min,
             children: [
               MenuItemWidget(
-                captionedTextWidget: const CaptionedTextWidget(title: "Backup"),
+                captionedTextWidget:
+                    CaptionedTextWidget(title: S.of(context).backup),
                 singleBorderRadius: 8.0,
                 menuItemColor: colorScheme.fillFaint,
                 alignCaptionedTextToLeft: true,
@@ -142,8 +144,8 @@ class _BackupHeaderWidgetState extends State<BackupHeaderWidget> {
                 builder: (BuildContext context, bool value, _) {
                   return MenuSectionDescriptionWidget(
                     content: value
-                        ? "Files added to this device album will automatically get uploaded to ente."
-                        : "Turn on backup to automatically upload files added to this device folder to ente.",
+                        ? S.of(context).deviceFilesAutoUploading
+                        : S.of(context).turnOnBackupForAutoUpload,
                   );
                 },
               ),
@@ -232,8 +234,8 @@ class _ResetIgnoredFilesWidgetState extends State<ResetIgnoredFilesWidget> {
       children: [
         const SizedBox(height: 24),
         MenuItemWidget(
-          captionedTextWidget: const CaptionedTextWidget(
-            title: "Reset ignored files",
+          captionedTextWidget: CaptionedTextWidget(
+            title: S.of(context).resetIgnoredFiles,
           ),
           singleBorderRadius: 8.0,
           menuItemColor: getEnteColorScheme(context).fillFaint,
@@ -248,9 +250,8 @@ class _ResetIgnoredFilesWidgetState extends State<ResetIgnoredFilesWidget> {
             });
           },
         ),
-        const MenuSectionDescriptionWidget(
-          content:
-              "Some files in this album are ignored from upload because they had previously been deleted from ente.",
+        MenuSectionDescriptionWidget(
+          content: S.of(context).ignoredFolderUploadReason,
         ),
       ],
     );

+ 11 - 10
lib/ui/viewer/gallery/gallery_app_bar_widget.dart

@@ -7,6 +7,7 @@ import 'package:logging/logging.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/core/event_bus.dart';
 import 'package:photos/events/subscription_purchased_event.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/models/backup_status.dart';
 import 'package:photos/models/collection.dart';
 import 'package:photos/models/device_collection.dart';
@@ -112,9 +113,9 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
     }
     final result = await showTextInputDialog(
       context,
-      title: "Rename album",
-      submitButtonLabel: "Rename",
-      hintText: "Enter album name",
+      title: S.of(context).renameAlbum,
+      submitButtonLabel: S.of(context).rename,
+      hintText: S.of(context).enterAlbumName,
       alwaysShowSuccessState: true,
       textCapitalization: TextCapitalization.words,
       onSubmit: (String text) async {
@@ -150,21 +151,21 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
           shouldStickToDarkTheme: true,
           buttonAction: ButtonAction.first,
           shouldSurfaceExecutionStates: true,
-          labelText: "Leave album",
+          labelText: S.of(context).leaveAlbum,
           onTap: () async {
             await CollectionsService.instance.leaveAlbum(widget.collection!);
           },
         ),
-        const ButtonWidget(
+        ButtonWidget(
           buttonType: ButtonType.secondary,
           buttonAction: ButtonAction.cancel,
           isInAlert: true,
           shouldStickToDarkTheme: true,
-          labelText: "Cancel",
+          labelText: S.of(context).cancel,
         )
       ],
-      title: "Leave shared album?",
-      body: "Photos added by you will be removed from the album",
+      title: S.of(context).leaveSharedAlbum,
+      body: S.of(context).photosAddedByYouWillBeRemovedFromTheAlbum,
     );
     if (actionResult?.action != null && mounted) {
       if (actionResult!.action == ButtonAction.error) {
@@ -196,8 +197,8 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
     if (status.localIDs.isEmpty) {
       showErrorDialog(
         context,
-        "✨ All clear",
-        "You've no files in this album that can be deleted",
+        S.of(context).allClear,
+        S.of(context).youveNoFilesInThisAlbumThatCanBeDeleted,
       );
     } else {
       final bool? result = await routeToPage(

+ 3 - 2
lib/ui/viewer/gallery/hidden_page.dart

@@ -4,6 +4,7 @@ import 'package:photos/core/configuration.dart';
 import 'package:photos/core/event_bus.dart';
 import 'package:photos/db/files_db.dart';
 import 'package:photos/events/files_updated_event.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/models/gallery_type.dart';
 import 'package:photos/models/selected_files.dart';
 import 'package:photos/services/collections_service.dart';
@@ -26,7 +27,7 @@ class HiddenPage extends StatelessWidget {
   }) : super(key: key);
 
   @override
-  Widget build(Object context) {
+  Widget build(BuildContext context) {
     final gallery = Gallery(
       asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) {
         return FilesDB.instance.getFilesInCollections(
@@ -69,7 +70,7 @@ class HiddenPage extends StatelessWidget {
         preferredSize: const Size.fromHeight(50.0),
         child: GalleryAppBarWidget(
           appBarType,
-          "Hidden",
+          S.of(context).hidden,
           _selectedFiles,
         ),
       ),

+ 3 - 2
lib/ui/viewer/gallery/photo_grid_size_picker_page.dart

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
 import 'package:photos/core/constants.dart';
 import 'package:photos/core/event_bus.dart';
 import 'package:photos/events/force_reload_home_gallery_event.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/ui/components/captioned_text_widget.dart';
 import 'package:photos/ui/components/divider_widget.dart';
@@ -20,9 +21,9 @@ class PhotoGridSizePickerPage extends StatelessWidget {
       body: CustomScrollView(
         primary: false,
         slivers: <Widget>[
-          const TitleBarWidget(
+          TitleBarWidget(
             flexibleSpaceTitle: TitleBarTitleWidget(
-              title: "Photo grid size",
+              title: S.of(context).photoGridSize,
             ),
           ),
           SliverList(

+ 7 - 4
lib/ui/viewer/gallery/trash_page.dart

@@ -6,6 +6,7 @@ import 'package:photos/core/event_bus.dart';
 import 'package:photos/db/trash_db.dart';
 import 'package:photos/events/files_updated_event.dart';
 import 'package:photos/events/force_reload_trash_page_event.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/models/gallery_type.dart';
 import 'package:photos/models/selected_files.dart';
 import 'package:photos/ui/common/bottom_shadow.dart';
@@ -27,7 +28,7 @@ class TrashPage extends StatelessWidget {
   }) : super(key: key);
 
   @override
-  Widget build(Object context) {
+  Widget build(BuildContext context) {
     final bool filesAreSelected = _selectedFiles.files.isNotEmpty;
 
     final gallery = Gallery(
@@ -60,7 +61,7 @@ class TrashPage extends StatelessWidget {
         preferredSize: const Size.fromHeight(50.0),
         child: GalleryAppBarWidget(
           appBarType,
-          "Trash",
+          S.of(context).trash,
           _selectedFiles,
         ),
       ),
@@ -102,7 +103,9 @@ class TrashPage extends StatelessWidget {
           return Padding(
             padding: const EdgeInsets.all(16),
             child: Text(
-              'Items show the number of days remaining before permanent deletion',
+              S
+                  .of(context)
+                  .itemsShowTheNumberOfDaysRemainingBeforePermanentDeletion,
               style:
                   Theme.of(context).textTheme.caption!.copyWith(fontSize: 16),
             ),
@@ -141,7 +144,7 @@ class BottomButtonsWidget extends StatelessWidget {
                       horizontal: 16,
                     ),
                     child: Text(
-                      'Delete All',
+                      S.of(context).deleteAll,
                       style: Theme.of(context).textTheme.subtitle2!.copyWith(
                             color: const Color.fromRGBO(255, 101, 101, 1),
                           ),

+ 4 - 3
lib/ui/viewer/gallery/uncategorized_page.dart

@@ -3,6 +3,7 @@ import 'package:photos/core/event_bus.dart';
 import 'package:photos/db/files_db.dart';
 import 'package:photos/events/collection_updated_event.dart';
 import 'package:photos/events/files_updated_event.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/models/collection.dart';
 import 'package:photos/models/file_load_result.dart';
 import 'package:photos/models/gallery_type.dart';
@@ -28,7 +29,7 @@ class UnCategorizedPage extends StatelessWidget {
   }) : super(key: key);
 
   @override
-  Widget build(Object context) {
+  Widget build(BuildContext context) {
     final gallery = Gallery(
       asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) async {
         final FileLoadResult result =
@@ -59,14 +60,14 @@ class UnCategorizedPage extends StatelessWidget {
       tagPrefix: tagPrefix,
       selectedFiles: _selectedFiles,
       initialFiles: null,
-      albumName: "Uncategorized",
+      albumName: S.of(context).uncategorized,
     );
     return Scaffold(
       appBar: PreferredSize(
         preferredSize: const Size.fromHeight(50.0),
         child: GalleryAppBarWidget(
           appBarType,
-          "Uncategorized",
+          S.of(context).uncategorized,
           _selectedFiles,
         ),
       ),