浏览代码

l10n: extract common subscription strings

Neeraj Gupta 2 年之前
父节点
当前提交
3abfeaf330

+ 64 - 44
lib/generated/intl/messages_en.dart

@@ -45,63 +45,70 @@ class MessageLookup extends MessageLookupByLibrary {
   static String m6(storageAmountInGB) =>
       "${storageAmountInGB} GB each time someone signs up for a paid plan and applies your code";
 
-  static String m7(count) =>
+  static String m7(endDate) => "Free trial valid till ${endDate}";
+
+  static String m8(count) =>
       "${Intl.plural(count, one: '${count} item', other: '${count} items')}";
 
-  static String m8(expiryTime) => "Link will expire on ${expiryTime}";
+  static String m9(expiryTime) => "Link will expire on ${expiryTime}";
 
-  static String m9(maxValue) =>
+  static String m10(maxValue) =>
       "When set to the maximum (${maxValue}), the device limit will be relaxed to allow for temporary spikes of large number of viewers.";
 
-  static String m10(count) =>
+  static String m11(count) =>
       "${Intl.plural(count, zero: 'no memories', one: '${count} memory', other: '${count} memories')}";
 
-  static String m11(passwordStrengthValue) =>
+  static String m12(passwordStrengthValue) =>
       "Password strength: ${passwordStrengthValue}";
 
-  static String m12(storeName) => "Rate us on ${storeName}";
+  static String m13(storeName) => "Rate us on ${storeName}";
 
-  static String m13(storageInGB) =>
+  static String m14(storageInGB) =>
       "3. Both of you get ${storageInGB} GB* free";
 
-  static String m14(userEmail) =>
+  static String m15(userEmail) =>
       "${userEmail} will be removed from this shared album\n\nAny photos added by them will also be removed from the album";
 
-  static String m15(count) => "${count} selected";
+  static String m16(endDate) => "Renews on ${endDate}";
+
+  static String m17(count) => "${count} selected";
 
-  static String m16(count, yourCount) =>
+  static String m18(count, yourCount) =>
       "${count} selected (${yourCount} yours)";
 
-  static String m17(verificationID) =>
+  static String m19(verificationID) =>
       "Here\'s my verification ID: ${verificationID} for ente.io.";
 
-  static String m18(verificationID) =>
+  static String m20(verificationID) =>
       "Hey, can you confirm that this is your ente.io verification ID: ${verificationID}";
 
-  static String m19(referralCode, referralStorageInGB) =>
+  static String m21(referralCode, referralStorageInGB) =>
       "ente referral code: ${referralCode} \n\nApply it in Settings → General → Referrals to get ${referralStorageInGB} GB free after you signup for a paid plan\n\nhttps://ente.io";
 
-  static String m20(numberOfPeople) =>
+  static String m22(numberOfPeople) =>
       "${Intl.plural(numberOfPeople, zero: 'Share with specific people', one: 'Shared with 1 person', other: 'Shared with ${numberOfPeople} people')}";
 
-  static String m21(fileType) =>
+  static String m23(fileType) =>
       "This ${fileType} will be deleted from your device.";
 
-  static String m22(fileType) =>
+  static String m24(fileType) =>
       "This ${fileType} is in both ente and your device.";
 
-  static String m23(fileType) => "This ${fileType} will be deleted from ente.";
+  static String m25(fileType) => "This ${fileType} will be deleted from ente.";
+
+  static String m26(storageAmountInGB) => "${storageAmountInGB} GB";
 
-  static String m24(storageAmountInGB) => "${storageAmountInGB} GB";
+  static String m27(endDate) =>
+      "Your subscription will be cancelled on ${endDate}";
 
-  static String m25(storageAmountInGB) =>
+  static String m28(storageAmountInGB) =>
       "They also get ${storageAmountInGB} GB";
 
-  static String m26(email) => "This is ${email}\'s Verification ID";
+  static String m29(email) => "This is ${email}\'s Verification ID";
 
-  static String m27(email) => "Verify ${email}";
+  static String m30(email) => "Verify ${email}";
 
-  static String m28(storageSaved) =>
+  static String m31(storageSaved) =>
       "You have successfully freed up ${storageSaved}!";
 
   final messages = _notInlinedMessages(_notInlinedMessages);
@@ -246,6 +253,8 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Creating link..."),
         "criticalUpdateAvailable":
             MessageLookupByLibrary.simpleMessage("Critical update available"),
+        "currentUsageIs":
+            MessageLookupByLibrary.simpleMessage("Current usage is "),
         "custom": MessageLookupByLibrary.simpleMessage("Custom"),
         "darkTheme": MessageLookupByLibrary.simpleMessage("Dark"),
         "decrypting": MessageLookupByLibrary.simpleMessage("Decrypting..."),
@@ -310,6 +319,10 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Encryption keys"),
         "endToEndEncrypted":
             MessageLookupByLibrary.simpleMessage("end-to-end encrypted"),
+        "enteSubscriptionPitch": MessageLookupByLibrary.simpleMessage(
+            "ente preserves your memories, so they\'re always available to you, even if you lose your device."),
+        "enteSubscriptionShareWithFamily": MessageLookupByLibrary.simpleMessage(
+            "Your family can be added to your plan as well."),
         "enterCode": MessageLookupByLibrary.simpleMessage("Enter code"),
         "enterCodeDescription": MessageLookupByLibrary.simpleMessage(
             "Enter the code provided by your friend to claim free storage for both of you"),
@@ -344,6 +357,7 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Failed to load albums"),
         "familyPlans": MessageLookupByLibrary.simpleMessage("Family plans"),
         "faq": MessageLookupByLibrary.simpleMessage("FAQ"),
+        "faqs": MessageLookupByLibrary.simpleMessage("FAQs"),
         "feedback": MessageLookupByLibrary.simpleMessage("Feedback"),
         "forgotPassword":
             MessageLookupByLibrary.simpleMessage("Forgot password"),
@@ -352,6 +366,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "freeStorageOnReferralSuccess": m6,
         "freeStorageUsable":
             MessageLookupByLibrary.simpleMessage("Free storage usable"),
+        "freeTrial": MessageLookupByLibrary.simpleMessage("Free trial"),
+        "freeTrialValidTill": m7,
         "freeUpDeviceSpace":
             MessageLookupByLibrary.simpleMessage("Free up device space"),
         "fromYourRegisteredEmailAddress": MessageLookupByLibrary.simpleMessage(
@@ -382,7 +398,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "inviteToEnte": MessageLookupByLibrary.simpleMessage("Invite to ente"),
         "inviteYourFriends":
             MessageLookupByLibrary.simpleMessage("Invite your friends"),
-        "itemCount": m7,
+        "itemCount": m8,
         "itemsWillBeRemovedFromAlbum": MessageLookupByLibrary.simpleMessage(
             "Selected items will be removed from this album"),
         "keepPhotos": MessageLookupByLibrary.simpleMessage("Keep Photos"),
@@ -392,7 +408,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "linkDeviceLimit": MessageLookupByLibrary.simpleMessage("Device limit"),
         "linkEnabled": MessageLookupByLibrary.simpleMessage("Enabled"),
         "linkExpired": MessageLookupByLibrary.simpleMessage("Expired"),
-        "linkExpiresOn": m8,
+        "linkExpiresOn": m9,
         "linkExpiry": MessageLookupByLibrary.simpleMessage("Link expiry"),
         "linkHasExpired":
             MessageLookupByLibrary.simpleMessage("Link has expired"),
@@ -413,8 +429,8 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Manage subscription"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
-        "maxDeviceLimitSpikeHandling": m9,
-        "memoryCount": m10,
+        "maxDeviceLimitSpikeHandling": m10,
+        "memoryCount": m11,
         "merchandise": MessageLookupByLibrary.simpleMessage("Merchandise"),
         "moderateStrength": MessageLookupByLibrary.simpleMessage("Moderate"),
         "movedToTrash": MessageLookupByLibrary.simpleMessage("Moved to trash"),
@@ -442,7 +458,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "passwordChangedSuccessfully": MessageLookupByLibrary.simpleMessage(
             "Password changed successfully"),
         "passwordLock": MessageLookupByLibrary.simpleMessage("Password lock"),
-        "passwordStrength": m11,
+        "passwordStrength": m12,
         "peopleUsingYourCode":
             MessageLookupByLibrary.simpleMessage("People using your code"),
         "photoGridSize":
@@ -460,7 +476,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "publicLinkEnabled":
             MessageLookupByLibrary.simpleMessage("Public link enabled"),
         "rateUs": MessageLookupByLibrary.simpleMessage("Rate us"),
-        "rateUsOnStore": m12,
+        "rateUsOnStore": m13,
         "recover": MessageLookupByLibrary.simpleMessage("Recover"),
         "recoverAccount":
             MessageLookupByLibrary.simpleMessage("Recover account"),
@@ -489,7 +505,7 @@ class MessageLookup extends MessageLookupByLibrary {
             "1. Give this code to your friends"),
         "referralStep2": MessageLookupByLibrary.simpleMessage(
             "2. They sign up for a paid plan"),
-        "referralStep3": m13,
+        "referralStep3": m14,
         "referrals": MessageLookupByLibrary.simpleMessage("Referrals"),
         "referralsAreCurrentlyPaused": MessageLookupByLibrary.simpleMessage(
             "Referrals are currently paused"),
@@ -505,7 +521,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "removeLink": MessageLookupByLibrary.simpleMessage("Remove link"),
         "removeParticipant":
             MessageLookupByLibrary.simpleMessage("Remove participant"),
-        "removeParticipantBody": m14,
+        "removeParticipantBody": m15,
         "removePublicLink":
             MessageLookupByLibrary.simpleMessage("Remove public link"),
         "removeShareItemsWarning": MessageLookupByLibrary.simpleMessage(
@@ -514,6 +530,7 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Remove?"),
         "removingFromFavorites":
             MessageLookupByLibrary.simpleMessage("Removing from favorites..."),
+        "renewsOn": m16,
         "reportABug": MessageLookupByLibrary.simpleMessage("Report a bug"),
         "reportBug": MessageLookupByLibrary.simpleMessage("Report bug"),
         "resendEmail": MessageLookupByLibrary.simpleMessage("Resend email"),
@@ -533,11 +550,13 @@ class MessageLookup extends MessageLookupByLibrary {
         "selectFoldersForBackup":
             MessageLookupByLibrary.simpleMessage("Select folders for backup"),
         "selectReason": MessageLookupByLibrary.simpleMessage("Select reason"),
+        "selectYourPlan":
+            MessageLookupByLibrary.simpleMessage("Select your plan"),
         "selectedFoldersWillBeEncryptedAndBackedUp":
             MessageLookupByLibrary.simpleMessage(
                 "Selected folders will be encrypted and backed up"),
-        "selectedPhotos": m15,
-        "selectedPhotosWithYours": m16,
+        "selectedPhotos": m17,
+        "selectedPhotosWithYours": m18,
         "sendEmail": MessageLookupByLibrary.simpleMessage("Send email"),
         "sendInvite": MessageLookupByLibrary.simpleMessage("Send invite"),
         "sendLink": MessageLookupByLibrary.simpleMessage("Send link"),
@@ -546,22 +565,22 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Set password"),
         "setupComplete": MessageLookupByLibrary.simpleMessage("Setup complete"),
         "shareALink": MessageLookupByLibrary.simpleMessage("Share a link"),
-        "shareMyVerificationID": m17,
-        "shareTextConfirmOthersVerificationID": m18,
+        "shareMyVerificationID": m19,
+        "shareTextConfirmOthersVerificationID": m20,
         "shareTextRecommendUsingEnte": MessageLookupByLibrary.simpleMessage(
             "Download ente so we can easily share original quality photos and videos\n\nhttps://ente.io/#download"),
-        "shareTextReferralCode": m19,
+        "shareTextReferralCode": m21,
         "shareWithNonenteUsers":
             MessageLookupByLibrary.simpleMessage("Share with non-ente users"),
-        "shareWithPeopleSectionTitle": m20,
+        "shareWithPeopleSectionTitle": m22,
         "sharedAlbumSectionDescription": MessageLookupByLibrary.simpleMessage(
             "Create shared and collaborative albums with other ente users, including users on free plans."),
         "sharing": MessageLookupByLibrary.simpleMessage("Sharing..."),
-        "singleFileDeleteFromDevice": m21,
+        "singleFileDeleteFromDevice": m23,
         "singleFileDeleteHighlight": MessageLookupByLibrary.simpleMessage(
             "It will be deleted from all albums."),
-        "singleFileInBothLocalAndRemote": m22,
-        "singleFileInRemoteOnly": m23,
+        "singleFileInBothLocalAndRemote": m24,
+        "singleFileInRemoteOnly": m25,
         "skip": MessageLookupByLibrary.simpleMessage("Skip"),
         "social": MessageLookupByLibrary.simpleMessage("Social"),
         "someoneSharingAlbumsWithYouShouldSeeTheSameId":
@@ -582,8 +601,9 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage(
                 "Sorry, we could not generate secure keys on this device.\n\nplease sign up from a different device."),
         "sparkleSuccess": MessageLookupByLibrary.simpleMessage("✨ Success"),
-        "storageInGB": m24,
+        "storageInGB": m26,
         "strongStrength": MessageLookupByLibrary.simpleMessage("Strong"),
+        "subWillBeCancelledOn": m27,
         "subscribe": MessageLookupByLibrary.simpleMessage("Subscribe"),
         "subscribeToEnableSharing": MessageLookupByLibrary.simpleMessage(
             "Looks like your subscription has expired. Please subscribe to enable sharing."),
@@ -607,12 +627,12 @@ class MessageLookup extends MessageLookupByLibrary {
         "theDownloadCouldNotBeCompleted": MessageLookupByLibrary.simpleMessage(
             "The download could not be completed"),
         "theme": MessageLookupByLibrary.simpleMessage("Theme"),
-        "theyAlsoGetXGb": m25,
+        "theyAlsoGetXGb": m28,
         "thisCanBeUsedToRecoverYourAccountIfYou":
             MessageLookupByLibrary.simpleMessage(
                 "This can be used to recover your account if you lose your second factor"),
         "thisDevice": MessageLookupByLibrary.simpleMessage("This device"),
-        "thisIsPersonVerificationId": m26,
+        "thisIsPersonVerificationId": m29,
         "thisIsYourVerificationId": MessageLookupByLibrary.simpleMessage(
             "This is your Verification ID"),
         "thisWillLogYouOutOfTheFollowingDevice":
@@ -644,7 +664,7 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Verification ID"),
         "verify": MessageLookupByLibrary.simpleMessage("Verify"),
         "verifyEmail": MessageLookupByLibrary.simpleMessage("Verify email"),
-        "verifyEmailID": m27,
+        "verifyEmailID": m30,
         "verifyPassword":
             MessageLookupByLibrary.simpleMessage("Verify password"),
         "verifyingRecoveryKey":
@@ -674,7 +694,7 @@ class MessageLookup extends MessageLookupByLibrary {
             "* You can at max double your storage"),
         "youCannotShareWithYourself": MessageLookupByLibrary.simpleMessage(
             "You cannot share with yourself"),
-        "youHaveSuccessfullyFreedUp": m28,
+        "youHaveSuccessfullyFreedUp": m31,
         "yourAccountHasBeenDeleted": MessageLookupByLibrary.simpleMessage(
             "Your account has been deleted"),
         "yourStorageDetailsCouldNotBeFetched":

+ 90 - 0
lib/generated/l10n.dart

@@ -3787,6 +3787,96 @@ class S {
       args: [],
     );
   }
+
+  /// `Free trial`
+  String get freeTrial {
+    return Intl.message(
+      'Free trial',
+      name: 'freeTrial',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Select your plan`
+  String get selectYourPlan {
+    return Intl.message(
+      'Select your plan',
+      name: 'selectYourPlan',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `ente preserves your memories, so they're always available to you, even if you lose your device.`
+  String get enteSubscriptionPitch {
+    return Intl.message(
+      'ente preserves your memories, so they\'re always available to you, even if you lose your device.',
+      name: 'enteSubscriptionPitch',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Your family can be added to your plan as well.`
+  String get enteSubscriptionShareWithFamily {
+    return Intl.message(
+      'Your family can be added to your plan as well.',
+      name: 'enteSubscriptionShareWithFamily',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Current usage is `
+  String get currentUsageIs {
+    return Intl.message(
+      'Current usage is ',
+      name: 'currentUsageIs',
+      desc: 'This text is followed by storage usaged',
+      args: [],
+    );
+  }
+
+  /// `FAQs`
+  String get faqs {
+    return Intl.message(
+      'FAQs',
+      name: 'faqs',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Renews on {endDate}`
+  String renewsOn(Object endDate) {
+    return Intl.message(
+      'Renews on $endDate',
+      name: 'renewsOn',
+      desc: '',
+      args: [endDate],
+    );
+  }
+
+  /// `Free trial valid till {endDate}`
+  String freeTrialValidTill(Object endDate) {
+    return Intl.message(
+      'Free trial valid till $endDate',
+      name: 'freeTrialValidTill',
+      desc: '',
+      args: [endDate],
+    );
+  }
+
+  /// `Your subscription will be cancelled on {endDate}`
+  String subWillBeCancelledOn(Object endDate) {
+    return Intl.message(
+      'Your subscription will be cancelled on $endDate',
+      name: 'subWillBeCancelledOn',
+      desc: '',
+      args: [endDate],
+    );
+  }
 }
 
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {

+ 17 - 1
lib/l10n/intl_en.arb

@@ -537,5 +537,21 @@
   "theme": "Theme",
   "lightTheme": "Light",
   "darkTheme" : "Dark",
-  "systemTheme": "System"
+  "systemTheme": "System",
+  "freeTrial": "Free trial",
+  "selectYourPlan": "Select your plan",
+  "enteSubscriptionPitch": "ente preserves your memories, so they're always available to you, even if you lose your device.",
+  "enteSubscriptionShareWithFamily": "Your family can be added to your plan as well.",
+  "currentUsageIs": "Current usage is ",
+  "@currentUsageIs": {
+    "description": "This text is followed by storage usaged",
+    "examples": [
+      "Current usage is 1.2 GB"
+    ],
+    "type": "text"
+  },
+  "faqs": "FAQs",
+  "renewsOn": "Renews on {endDate}",
+  "freeTrialValidTill": "Free trial valid till {endDate}",
+  "subWillBeCancelledOn": "Your subscription will be cancelled on {endDate}"
 }

+ 10 - 9
lib/ui/payment/subscription_common_widgets.dart

@@ -1,5 +1,6 @@
 import 'package:flutter/material.dart';
 import 'package:photos/ente_theme_data.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/models/subscription.dart';
 import "package:photos/theme/ente_theme.dart";
 import "package:photos/ui/components/captioned_text_widget.dart";
@@ -36,19 +37,19 @@ class _SubscriptionHeaderWidgetState extends State<SubscriptionHeaderWidget> {
             Row(
               children: [
                 Text(
-                  "Select your plan",
+                  S.of(context).selectYourPlan,
                   style: Theme.of(context).textTheme.headline4,
                 ),
               ],
             ),
             const SizedBox(height: 10),
             Text(
-              "ente preserves your memories, so they're always available to you, even if you lose your device.",
+              S.of(context).enteSubscriptionPitch,
               style: Theme.of(context).textTheme.caption,
             ),
             const SizedBox(height: 4),
             Text(
-              "Your family can be added to your plan as well. ",
+              S.of(context).enteSubscriptionShareWithFamily,
               style: Theme.of(context).textTheme.caption,
             ),
           ],
@@ -64,7 +65,7 @@ class _SubscriptionHeaderWidgetState extends State<SubscriptionHeaderWidget> {
             text: TextSpan(
               children: [
                 TextSpan(
-                  text: "Current usage is ",
+                  text: S.of(context).currentUsageIs,
                   style: Theme.of(context).textTheme.subtitle1,
                 ),
                 TextSpan(
@@ -96,11 +97,11 @@ class ValidityWidget extends StatelessWidget {
     final endDate = getDateAndMonthAndYear(
       DateTime.fromMicrosecondsSinceEpoch(currentSubscription!.expiryTime),
     );
-    var message = "Renews on $endDate";
+    var message = S.of(context).renewsOn(endDate);
     if (currentSubscription!.productID == freeProductID) {
-      message = "Free trial valid till $endDate";
+      message = S.of(context).freeTrialValidTill(endDate);
     } else if (currentSubscription!.attributes?.isCancelled ?? false) {
-      message = "Your subscription will be cancelled on $endDate";
+      message = S.of(context).subWillBeCancelledOn(endDate);
     }
     return Padding(
       padding: const EdgeInsets.only(top: 8),
@@ -123,8 +124,8 @@ class SubFaqWidget extends StatelessWidget {
     return Padding(
       padding: EdgeInsets.fromLTRB(16, 40, 16, isOnboarding ? 40 : 4),
       child: MenuItemWidget(
-        captionedTextWidget: const CaptionedTextWidget(
-          title: "FAQs",
+        captionedTextWidget: CaptionedTextWidget(
+          title: S.of(context).faqs,
         ),
         menuItemColor: colorScheme.fillFaint,
         trailingWidget: Icon(

+ 5 - 3
lib/ui/payment/subscription_plan_widget.dart

@@ -1,4 +1,5 @@
 import 'package:flutter/material.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/utils/data_util.dart';
 
 class SubscriptionPlanWidget extends StatelessWidget {
@@ -15,9 +16,10 @@ class SubscriptionPlanWidget extends StatelessWidget {
   final String period;
   final bool isActive;
 
-  String _displayPrice() {
+  String _displayPrice(BuildContext context) {
+    // todo: l10n pricing part
     final result = price + (period.isNotEmpty ? " / " + period : "");
-    return price.isNotEmpty ? result : "Free trial";
+    return price.isNotEmpty ? result : S.of(context).freeTrial;
   }
 
   @override
@@ -59,7 +61,7 @@ class SubscriptionPlanWidget extends StatelessWidget {
                       .copyWith(color: textColor),
                 ),
                 Text(
-                  _displayPrice(),
+                  _displayPrice(context),
                   style: Theme.of(context).textTheme.headline6!.copyWith(
                         color: textColor,
                         fontWeight: FontWeight.normal,