Selaa lähdekoodia

l10n: extract strigns

Neeraj Gupta 2 vuotta sitten
vanhempi
commit
72f579eaa7

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

@@ -27,6 +27,7 @@ class MessageLookup extends MessageLookupByLibrary {
       "${Intl.select(isFamilyMember, {
             'true': 'Your family has claimed ${storageAmountInGb} Gb so far',
             'false': 'You have claimed ${storageAmountInGb} Gb so far',
+            'other': 'You have claimed ${storageAmountInGb} Gb so far!',
           })}";
 
   static String m2(supportEmail) =>
@@ -85,6 +86,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "addMore": MessageLookupByLibrary.simpleMessage("Add more"),
         "addViewer": MessageLookupByLibrary.simpleMessage("Add viewer"),
         "addedAs": MessageLookupByLibrary.simpleMessage("Added as"),
+        "addingToFavorites":
+            MessageLookupByLibrary.simpleMessage("Adding to favorites..."),
         "after1Day": MessageLookupByLibrary.simpleMessage("After 1 day"),
         "after1Hour": MessageLookupByLibrary.simpleMessage("After 1 hour"),
         "after1Month": MessageLookupByLibrary.simpleMessage("After 1 month"),
@@ -105,6 +108,8 @@ class MessageLookup extends MessageLookupByLibrary {
             "What is the main reason you are deleting your account?"),
         "byClickingLogInIAgreeToThe": MessageLookupByLibrary.simpleMessage(
             "By clicking log in, I agree to the"),
+        "canOnlyRemoveFilesOwnedByYou": MessageLookupByLibrary.simpleMessage(
+            "Can only remove files owned by you"),
         "cancel": MessageLookupByLibrary.simpleMessage("Cancel"),
         "cannotAddMorePhotosAfterBecomingViewer": m0,
         "changeEmail": MessageLookupByLibrary.simpleMessage("Change email"),
@@ -164,6 +169,7 @@ class MessageLookup extends MessageLookupByLibrary {
             "We are sorry to see you go. Please share your feedback to help us improve."),
         "deleteAccountPermanentlyButton":
             MessageLookupByLibrary.simpleMessage("Delete Account Permanently"),
+        "deleteAlbum": MessageLookupByLibrary.simpleMessage("Delete album"),
         "deleteConfirmDialogBody": MessageLookupByLibrary.simpleMessage(
             "You are about to permanently delete your account and all its data.\nThis action is irreversible."),
         "deleteReason1": MessageLookupByLibrary.simpleMessage(
@@ -176,6 +182,10 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("My reason isn’t listed"),
         "deleteRequestSLAText": MessageLookupByLibrary.simpleMessage(
             "Your request will be processed within 72 hours."),
+        "deleteSharedAlbum":
+            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"),
         "details": MessageLookupByLibrary.simpleMessage("Details"),
         "disableDownloadWarningBody": MessageLookupByLibrary.simpleMessage(
             "Viewers can still take screenshots or save a copy of your photos using external tools"),
@@ -251,6 +261,8 @@ class MessageLookup extends MessageLookupByLibrary {
             "The recovery key you entered is not valid. Please make sure it "),
         "inviteYourFriends":
             MessageLookupByLibrary.simpleMessage("Invite your friends"),
+        "itemsWillBeRemovedFromAlbum": MessageLookupByLibrary.simpleMessage(
+            "Selected items will be removed from this album"),
         "kindlyHelpUsWithThisInformation": MessageLookupByLibrary.simpleMessage(
             "Kindly help us with this information"),
         "linkDeviceLimit": MessageLookupByLibrary.simpleMessage("Device limit"),
@@ -332,9 +344,15 @@ class MessageLookup extends MessageLookupByLibrary {
         "referralsAreCurrentlyPaused": MessageLookupByLibrary.simpleMessage(
             "Referrals are currently paused"),
         "remove": MessageLookupByLibrary.simpleMessage("Remove"),
+        "removeFromAlbum":
+            MessageLookupByLibrary.simpleMessage("Remove from album?"),
         "removeLink": MessageLookupByLibrary.simpleMessage("Remove link"),
         "removeParticipant":
             MessageLookupByLibrary.simpleMessage("Remove participant"),
+        "removeShareItemsWarning": MessageLookupByLibrary.simpleMessage(
+            "Some of the items you are removing were added by other people, and you will lose access to them"),
+        "removingFromFavorites":
+            MessageLookupByLibrary.simpleMessage("Removing from favorites..."),
         "resendEmail": MessageLookupByLibrary.simpleMessage("Resend email"),
         "resetPasswordTitle":
             MessageLookupByLibrary.simpleMessage("Reset password"),
@@ -374,11 +392,19 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage(
                 "Something went wrong, please try again"),
         "sorry": MessageLookupByLibrary.simpleMessage("Sorry"),
+        "sorryCouldNotAddToFavorites": MessageLookupByLibrary.simpleMessage(
+            "Sorry, could not add to favorites!"),
+        "sorryCouldNotRemoveFromFavorites":
+            MessageLookupByLibrary.simpleMessage(
+                "Sorry, could not remove from favorites!"),
         "sorryWeCouldNotGenerateSecureKeysOnThisDevicennplease":
             MessageLookupByLibrary.simpleMessage(
                 "Sorry, we could not generate secure keys on this device.\n\nplease sign up from a different device."),
         "storageInGB": m13,
         "strongStrength": MessageLookupByLibrary.simpleMessage("Strong"),
+        "subscribe": MessageLookupByLibrary.simpleMessage("Subscribe"),
+        "subscribeToEnableSharing": MessageLookupByLibrary.simpleMessage(
+            "Looks like your subscription has expired. Please subscribe to enable sharing."),
         "tapToCopy": MessageLookupByLibrary.simpleMessage("tap to copy"),
         "tapToEnterCode":
             MessageLookupByLibrary.simpleMessage("Tap to enter code"),

+ 133 - 2
lib/generated/l10n.dart

@@ -2262,13 +2262,14 @@ class S {
     );
   }
 
-  /// `{isFamilyMember, select, true {Your family has claimed {storageAmountInGb} Gb so far} false {You have claimed {storageAmountInGb} Gb so far}}`
-  String claimedStorageSoFar(bool isFamilyMember, int storageAmountInGb) {
+  /// `{isFamilyMember, select, true {Your family has claimed {storageAmountInGb} Gb so far} false {You have claimed {storageAmountInGb} Gb so far} other {You have claimed {storageAmountInGb} Gb so far!}}`
+  String claimedStorageSoFar(String isFamilyMember, int storageAmountInGb) {
     return Intl.select(
       isFamilyMember,
       {
         'true': 'Your family has claimed $storageAmountInGb Gb so far',
         'false': 'You have claimed $storageAmountInGb Gb so far',
+        'other': 'You have claimed $storageAmountInGb Gb so far!',
       },
       name: 'claimedStorageSoFar',
       desc: '',
@@ -2365,6 +2366,136 @@ class S {
       args: [],
     );
   }
+
+  /// `Remove from album?`
+  String get removeFromAlbum {
+    return Intl.message(
+      'Remove from album?',
+      name: 'removeFromAlbum',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Selected items will be removed from this album`
+  String get itemsWillBeRemovedFromAlbum {
+    return Intl.message(
+      'Selected items will be removed from this album',
+      name: 'itemsWillBeRemovedFromAlbum',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Some of the items you are removing were added by other people, and you will lose access to them`
+  String get removeShareItemsWarning {
+    return Intl.message(
+      'Some of the items you are removing were added by other people, and you will lose access to them',
+      name: 'removeShareItemsWarning',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Adding to favorites...`
+  String get addingToFavorites {
+    return Intl.message(
+      'Adding to favorites...',
+      name: 'addingToFavorites',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Removing from favorites...`
+  String get removingFromFavorites {
+    return Intl.message(
+      'Removing from favorites...',
+      name: 'removingFromFavorites',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Sorry, could not add to favorites!`
+  String get sorryCouldNotAddToFavorites {
+    return Intl.message(
+      'Sorry, could not add to favorites!',
+      name: 'sorryCouldNotAddToFavorites',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Sorry, could not remove from favorites!`
+  String get sorryCouldNotRemoveFromFavorites {
+    return Intl.message(
+      'Sorry, could not remove from favorites!',
+      name: 'sorryCouldNotRemoveFromFavorites',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Looks like your subscription has expired. Please subscribe to enable sharing.`
+  String get subscribeToEnableSharing {
+    return Intl.message(
+      'Looks like your subscription has expired. Please subscribe to enable sharing.',
+      name: 'subscribeToEnableSharing',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Subscribe`
+  String get subscribe {
+    return Intl.message(
+      'Subscribe',
+      name: 'subscribe',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Can only remove files owned by you`
+  String get canOnlyRemoveFilesOwnedByYou {
+    return Intl.message(
+      'Can only remove files owned by you',
+      name: 'canOnlyRemoveFilesOwnedByYou',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Delete shared album?`
+  String get deleteSharedAlbum {
+    return Intl.message(
+      'Delete shared album?',
+      name: 'deleteSharedAlbum',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Delete album`
+  String get deleteAlbum {
+    return Intl.message(
+      'Delete album',
+      name: 'deleteAlbum',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `The album will be deleted for everyone\n\nYou will lose access to shared photos in this album that are owned by others`
+  String get deleteSharedAlbumDialogBody {
+    return Intl.message(
+      'The album will be deleted for everyone\n\nYou will lose access to shared photos in this album that are owned by others',
+      name: 'deleteSharedAlbumDialogBody',
+      desc: '',
+      args: [],
+    );
+  }
 }
 
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {

+ 20 - 6
lib/l10n/intl_en.arb

@@ -306,17 +306,18 @@
   "referralStep3": "3. Both of you get {storageInGB} GB* free",
   "referralsAreCurrentlyPaused": "Referrals are currently paused",
   "youCanAtMaxDoubleYourStorage": "* You can at max double your storage",
-  "claimedStorageSoFar" : "{isFamilyMember, select, true {Your family has claimed {storageAmountInGb} Gb so far} false {You have claimed {storageAmountInGb} Gb so far}}",
+  "claimedStorageSoFar": "{isFamilyMember, select, true {Your family has claimed {storageAmountInGb} Gb so far} false {You have claimed {storageAmountInGb} Gb so far} other {You have claimed {storageAmountInGb} Gb so far!}}",
   "@claimedStorageSoFar": {
     "placeholders": {
+      "isFamilyMember": {
+        "type": "String",
+        "example": "true"
+      },
       "storageAmountInGb": {
         "type": "int",
         "example": "10"
-      },
-      "isFamilyMember": {
-        "type": "bool",
-        "example": "true"
       }
+
     }
   },
   "faq": "FAQ",
@@ -327,5 +328,18 @@
   "codeUsedByYou": "Code used by you",
   "freeStorageClaimed": "Free storage claimed",
   "freeStorageUsable": "Free storage usable",
-  "usableReferralStorageInfo": "Usable storage is limited by your current plan. Excess claimed storage will automatically become usable when you upgrade your plan."
+  "usableReferralStorageInfo": "Usable storage is limited by your current plan. Excess claimed storage will automatically become usable when you upgrade your plan.",
+  "removeFromAlbum": "Remove from album?",
+  "itemsWillBeRemovedFromAlbum": "Selected items will be removed from this album",
+  "removeShareItemsWarning": "Some of the items you are removing were added by other people, and you will lose access to them",
+  "addingToFavorites": "Adding to favorites...",
+  "removingFromFavorites": "Removing from favorites...",
+  "sorryCouldNotAddToFavorites": "Sorry, could not add to favorites!",
+  "sorryCouldNotRemoveFromFavorites": "Sorry, could not remove from favorites!",
+  "subscribeToEnableSharing": "Looks like your subscription has expired. Please subscribe to enable sharing.",
+  "subscribe": "Subscribe",
+  "canOnlyRemoveFilesOwnedByYou": "Can only remove files owned by you",
+  "deleteSharedAlbum": "Delete shared album?",
+  "deleteAlbum": "Delete album",
+  "deleteSharedAlbumDialogBody": "The album will be deleted for everyone\n\nYou will lose access to shared photos in this album that are owned by others"
 }

+ 13 - 10
lib/ui/actions/collection/collection_file_actions.dart

@@ -1,4 +1,5 @@
 import 'package:flutter/cupertino.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/models/collection.dart';
 import 'package:photos/models/file.dart';
 import 'package:photos/models/selected_files.dart';
@@ -22,7 +23,7 @@ extension CollectionFileActions on CollectionActions {
       context: bContext,
       buttons: [
         ButtonWidget(
-          labelText: "Remove",
+          labelText: S.of(bContext).remove,
           buttonType:
               removingOthersFile ? ButtonType.critical : ButtonType.neutral,
           buttonSize: ButtonSize.large,
@@ -41,8 +42,8 @@ extension CollectionFileActions on CollectionActions {
             }
           },
         ),
-        const ButtonWidget(
-          labelText: "Cancel",
+        ButtonWidget(
+          labelText: S.of(bContext).cancel,
           buttonType: ButtonType.secondary,
           buttonSize: ButtonSize.large,
           buttonAction: ButtonAction.second,
@@ -50,11 +51,10 @@ extension CollectionFileActions on CollectionActions {
           isInAlert: true,
         ),
       ],
-      title: removingOthersFile ? "Remove from album?" : null,
+      title: removingOthersFile ? S.of(bContext).removeFromAlbum : null,
       body: removingOthersFile
-          ? "Some of the items you are removing were "
-              "added by other people, and you will lose access to them"
-          : "Selected items will be removed from this album",
+          ? S.of(bContext).removeShareItemsWarning
+          : S.of(bContext).itemsWillBeRemovedFromAlbum,
       actionSheetType: ActionSheetType.defaultActionSheet,
     );
     if (actionResult?.action != null &&
@@ -72,7 +72,9 @@ extension CollectionFileActions on CollectionActions {
   ) async {
     final ProgressDialog dialog = createProgressDialog(
       context,
-      markAsFavorite ? "Adding to favorites..." : "Removing from favorites...",
+      markAsFavorite
+          ? S.of(context).addingToFavorites
+          : S.of(context).removingFromFavorites,
     );
     await dialog.show();
 
@@ -84,8 +86,9 @@ extension CollectionFileActions on CollectionActions {
       logger.severe(e, s);
       showShortToast(
         context,
-        "Sorry, could not" +
-            (markAsFavorite ? "add  to favorites!" : "remove from favorites!"),
+        markAsFavorite
+            ? S.of(context).sorryCouldNotAddToFavorites
+            : S.of(context).sorryCouldNotRemoveFromFavorites,
       );
     } finally {
       await dialog.hide();

+ 10 - 11
lib/ui/actions/collection/collection_sharing_actions.dart

@@ -3,6 +3,7 @@ import 'package:logging/logging.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/db/files_db.dart';
 import 'package:photos/ente_theme_data.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/models/api/collection/create_request.dart';
 import 'package:photos/models/collection.dart';
 import 'package:photos/models/file.dart';
@@ -367,10 +368,9 @@ class CollectionActions {
     final actionResult = await showChoiceActionSheet(
       context,
       isCritical: true,
-      title: "Delete shared album?",
-      firstButtonLabel: "Delete album",
-      body: "The album will be deleted for everyone\n\nYou will lose access to "
-          "shared photos in this album that are owned by others",
+      title: S.of(context).deleteSharedAlbum,
+      firstButtonLabel: S.of(context).deleteAlbum,
+      body: S.of(context).deleteSharedAlbumDialogBody,
     );
     return actionResult?.action != null &&
         actionResult!.action == ButtonAction.first;
@@ -420,7 +420,7 @@ class CollectionActions {
     }
 
     if (!isCollectionOwner && split.ownedByOtherUsers.isNotEmpty) {
-      showShortToast(context, "Can only remove files owned by you");
+      showShortToast(context, S.of(context).canOnlyRemoveFilesOwnedByYou);
       return;
     }
 
@@ -523,15 +523,14 @@ class CollectionActions {
 
   void _showUnSupportedAlert(BuildContext context) {
     final AlertDialog alert = AlertDialog(
-      title: const Text("Sorry"),
-      content: const Text(
-        "Looks like your subscription has expired. Please subscribe to enable"
-        " sharing.",
+      title: Text(S.of(context).sorry),
+      content: Text(
+        S.of(context).subscribeToEnableSharing,
       ),
       actions: [
         TextButton(
           child: Text(
-            "Subscribe",
+            S.of(context).subscribe,
             style: TextStyle(
               color: Theme.of(context).colorScheme.greenAlternative,
             ),
@@ -549,7 +548,7 @@ class CollectionActions {
         ),
         TextButton(
           child: Text(
-            "Ok",
+            S.of(context).ok,
             style: TextStyle(
               color: Theme.of(context).colorScheme.onSurface,
             ),

+ 1 - 1
lib/ui/growth/referral_screen.dart

@@ -267,7 +267,7 @@ class ReferralWidget extends StatelessWidget {
           ),
           child: Text(
             S.of(context).claimedStorageSoFar(
-                  referralView.isFamilyMember,
+                  referralView.isFamilyMember.toString().toLowerCase(),
                   convertBytesToAbsoluteGBs(referralView.claimedStorage),
                 ),
             style: textStyle.small.copyWith(