Forráskód Böngészése

l10n: extract ReferralScreen strings

Neeraj Gupta 2 éve
szülő
commit
ab09e70928

+ 53 - 28
lib/generated/intl/messages_en.dart

@@ -23,43 +23,51 @@ class MessageLookup extends MessageLookupByLibrary {
   static String m0(user) =>
       "${user} will not be able to add more photos to this album\n\nThey will still be able to remove existing photos added by them";
 
-  static String m1(supportEmail) =>
+  static String m1(isFamilyMember, storageAmountInGb) =>
+      "${Intl.select(isFamilyMember, {
+            'true': 'Your family has claimed ${storageAmountInGb} Gb so far',
+            'false': 'You have claimed ${storageAmountInGb} Gb so far',
+          })}";
+
+  static String m2(supportEmail) =>
       "Please drop an email to ${supportEmail} from your registered email address";
 
-  static String m2(email) =>
+  static String m3(email) =>
       "${email} does not have an ente account.\n\nSend them an invite to share photos.";
 
-  static String m3(storageAmountInGB) =>
+  static String m4(storageAmountInGB) =>
       "${storageAmountInGB} GB each time someone signs up for a paid plan and applies your code";
 
-  static String m4(expiryTime) => "Link will expire on ${expiryTime}";
+  static String m5(expiryTime) => "Link will expire on ${expiryTime}";
 
-  static String m5(maxValue) =>
+  static String m6(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 m6(passwordStrengthValue) =>
+  static String m7(passwordStrengthValue) =>
       "Password strength: ${passwordStrengthValue}";
 
-  static String m7(verificationID) =>
+  static String m8(storageInGB) => "3. Both of you get ${storageInGB} GB* free";
+
+  static String m9(verificationID) =>
       "Here\'s my verification ID: ${verificationID} for ente.io.";
 
-  static String m8(verificationID) =>
+  static String m10(verificationID) =>
       "Hey, can you confirm that this is your ente.io verification ID: ${verificationID}";
 
-  static String m9(referralCode, referralStorageInGB) =>
+  static String m11(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 m10(numberOfPeople) =>
+  static String m12(numberOfPeople) =>
       "${Intl.plural(numberOfPeople, zero: 'Share with specific people', one: 'Shared with 1 person', other: 'Shared with ${numberOfPeople} people')}";
 
-  static String m11(storageAmountInGB) => "${storageAmountInGB} GB";
+  static String m13(storageAmountInGB) => "${storageAmountInGB} GB";
 
-  static String m12(storageAmountInGB) =>
+  static String m14(storageAmountInGB) =>
       "They also get ${storageAmountInGB} GB";
 
-  static String m13(email) => "This is ${email}\'s Verification ID";
+  static String m15(email) => "This is ${email}\'s Verification ID";
 
-  static String m14(email) => "Verify ${email}";
+  static String m16(email) => "Verify ${email}";
 
   final messages = _notInlinedMessages(_notInlinedMessages);
   static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
@@ -106,8 +114,11 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Change permissions?"),
         "checkInboxAndSpamFolder": MessageLookupByLibrary.simpleMessage(
             "Please check your inbox (and spam) to complete verification"),
+        "claimFreeStorage":
+            MessageLookupByLibrary.simpleMessage("Claim free storage"),
         "claimMore": MessageLookupByLibrary.simpleMessage("Claim more!"),
         "claimed": MessageLookupByLibrary.simpleMessage("Claimed"),
+        "claimedStorageSoFar": m1,
         "codeAppliedPageTitle":
             MessageLookupByLibrary.simpleMessage("Code applied"),
         "codeCopiedToClipboard":
@@ -170,9 +181,9 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Please note"),
         "doThisLater": MessageLookupByLibrary.simpleMessage("Do this later"),
         "done": MessageLookupByLibrary.simpleMessage("Done"),
-        "dropSupportEmail": m1,
+        "dropSupportEmail": m2,
         "email": MessageLookupByLibrary.simpleMessage("Email"),
-        "emailNoEnteAccount": m2,
+        "emailNoEnteAccount": m3,
         "encryption": MessageLookupByLibrary.simpleMessage("Encryption"),
         "encryptionKeys":
             MessageLookupByLibrary.simpleMessage("Encryption keys"),
@@ -204,10 +215,13 @@ class MessageLookup extends MessageLookupByLibrary {
             "This link has expired. Please select a new expiry time or disable link expiry."),
         "failedToApplyCode":
             MessageLookupByLibrary.simpleMessage("Failed to apply code"),
+        "failedToFetchReferralDetails": MessageLookupByLibrary.simpleMessage(
+            "Unable to fetch referral details. Please try again later."),
+        "faq": MessageLookupByLibrary.simpleMessage("FAQ"),
         "feedback": MessageLookupByLibrary.simpleMessage("Feedback"),
         "forgotPassword":
             MessageLookupByLibrary.simpleMessage("Forgot password"),
-        "freeStorageOnReferralSuccess": m3,
+        "freeStorageOnReferralSuccess": m4,
         "fromYourRegisteredEmailAddress": MessageLookupByLibrary.simpleMessage(
             "from your registered email address."),
         "generatingEncryptionKeys": MessageLookupByLibrary.simpleMessage(
@@ -228,12 +242,14 @@ class MessageLookup extends MessageLookupByLibrary {
         "invalidKey": MessageLookupByLibrary.simpleMessage("Invalid key"),
         "invalidRecoveryKey": MessageLookupByLibrary.simpleMessage(
             "The recovery key you entered is not valid. Please make sure it "),
+        "inviteYourFriends":
+            MessageLookupByLibrary.simpleMessage("Invite your friends"),
         "kindlyHelpUsWithThisInformation": MessageLookupByLibrary.simpleMessage(
             "Kindly help us with this information"),
         "linkDeviceLimit": MessageLookupByLibrary.simpleMessage("Device limit"),
         "linkEnabled": MessageLookupByLibrary.simpleMessage("Enabled"),
         "linkExpired": MessageLookupByLibrary.simpleMessage("Expired"),
-        "linkExpiresOn": m4,
+        "linkExpiresOn": m5,
         "linkExpiry": MessageLookupByLibrary.simpleMessage("Link expiry"),
         "linkHasExpired":
             MessageLookupByLibrary.simpleMessage("Link has expired"),
@@ -244,7 +260,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "manage": MessageLookupByLibrary.simpleMessage("Manage"),
         "manageLink": MessageLookupByLibrary.simpleMessage("Manage link"),
         "manageParticipants": MessageLookupByLibrary.simpleMessage("Manage"),
-        "maxDeviceLimitSpikeHandling": m5,
+        "maxDeviceLimitSpikeHandling": m6,
         "moderateStrength": MessageLookupByLibrary.simpleMessage("Moderate"),
         "never": MessageLookupByLibrary.simpleMessage("Never"),
         "noPasswordWarningPart1": MessageLookupByLibrary.simpleMessage(
@@ -263,7 +279,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "passwordChangedSuccessfully": MessageLookupByLibrary.simpleMessage(
             "Password changed successfully"),
         "passwordLock": MessageLookupByLibrary.simpleMessage("Password lock"),
-        "passwordStrength": m6,
+        "passwordStrength": m7,
         "pleaseSendAnEmailTo":
             MessageLookupByLibrary.simpleMessage("Please send an email to"),
         "pleaseTryAgain":
@@ -297,6 +313,13 @@ class MessageLookup extends MessageLookupByLibrary {
             "The current device is not powerful enough to verify your "),
         "recreatePasswordTitle":
             MessageLookupByLibrary.simpleMessage("Recreate password"),
+        "referralStep1": MessageLookupByLibrary.simpleMessage(
+            "1. Give this code to your friends"),
+        "referralStep2": MessageLookupByLibrary.simpleMessage(
+            "2. They sign up for a paid plan"),
+        "referralStep3": m8,
+        "referralsAreCurrentlyPaused": MessageLookupByLibrary.simpleMessage(
+            "Referrals are currently paused"),
         "remove": MessageLookupByLibrary.simpleMessage("Remove"),
         "removeLink": MessageLookupByLibrary.simpleMessage("Remove link"),
         "removeParticipant":
@@ -321,14 +344,14 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Set password"),
         "setupComplete": MessageLookupByLibrary.simpleMessage("Setup complete"),
         "shareALink": MessageLookupByLibrary.simpleMessage("Share a link"),
-        "shareMyVerificationID": m7,
-        "shareTextConfirmOthersVerificationID": m8,
+        "shareMyVerificationID": m9,
+        "shareTextConfirmOthersVerificationID": m10,
         "shareTextRecommendUsingEnte": MessageLookupByLibrary.simpleMessage(
             "Download ente so we can easily share original "),
-        "shareTextReferralCode": m9,
+        "shareTextReferralCode": m11,
         "shareWithNonenteUsers":
             MessageLookupByLibrary.simpleMessage("Share with non-ente users"),
-        "shareWithPeopleSectionTitle": m10,
+        "shareWithPeopleSectionTitle": m12,
         "sharedAlbumSectionDescription": MessageLookupByLibrary.simpleMessage(
             "Create shared and collaborative albums with other ente users, including users on free plans."),
         "someoneSharingAlbumsWithYouShouldSeeTheSameId":
@@ -343,7 +366,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "sorryWeCouldNotGenerateSecureKeysOnThisDevicennplease":
             MessageLookupByLibrary.simpleMessage(
                 "Sorry, we could not generate secure keys on this device.\n\nplease sign up from a different device."),
-        "storageInGB": m11,
+        "storageInGB": m13,
         "strongStrength": MessageLookupByLibrary.simpleMessage("Strong"),
         "tapToCopy": MessageLookupByLibrary.simpleMessage("tap to copy"),
         "tapToEnterCode":
@@ -356,12 +379,12 @@ class MessageLookup extends MessageLookupByLibrary {
         "termsOfService":
             MessageLookupByLibrary.simpleMessage("terms of service"),
         "termsOfServicesTitle": MessageLookupByLibrary.simpleMessage("Terms"),
-        "theyAlsoGetXGb": m12,
+        "theyAlsoGetXGb": m14,
         "thisCanBeUsedToRecoverYourAccountIfYou":
             MessageLookupByLibrary.simpleMessage(
                 "This can be used to recover your account if you lose your second factor"),
         "thisDevice": MessageLookupByLibrary.simpleMessage("This device"),
-        "thisIsPersonVerificationId": m13,
+        "thisIsPersonVerificationId": m15,
         "thisIsYourVerificationId": MessageLookupByLibrary.simpleMessage(
             "This is your Verification ID"),
         "thisWillLogYouOutOfTheFollowingDevice":
@@ -380,7 +403,7 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Verification ID"),
         "verify": MessageLookupByLibrary.simpleMessage("Verify"),
         "verifyEmail": MessageLookupByLibrary.simpleMessage("Verify email"),
-        "verifyEmailID": m14,
+        "verifyEmailID": m16,
         "verifyPassword":
             MessageLookupByLibrary.simpleMessage("Verify password"),
         "verifyingRecoveryKey":
@@ -395,6 +418,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "yesConvertToViewer":
             MessageLookupByLibrary.simpleMessage("Yes, convert to viewer"),
         "you": MessageLookupByLibrary.simpleMessage("You"),
+        "youCanAtMaxDoubleYourStorage": MessageLookupByLibrary.simpleMessage(
+            "* You can at max double your storage"),
         "yourAccountHasBeenDeleted": MessageLookupByLibrary.simpleMessage(
             "Your account has been deleted")
       };

+ 104 - 0
lib/generated/l10n.dart

@@ -2181,6 +2181,110 @@ class S {
       args: [referralCode, referralStorageInGB],
     );
   }
+
+  /// `Claim free storage`
+  String get claimFreeStorage {
+    return Intl.message(
+      'Claim free storage',
+      name: 'claimFreeStorage',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Invite your friends`
+  String get inviteYourFriends {
+    return Intl.message(
+      'Invite your friends',
+      name: 'inviteYourFriends',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Unable to fetch referral details. Please try again later.`
+  String get failedToFetchReferralDetails {
+    return Intl.message(
+      'Unable to fetch referral details. Please try again later.',
+      name: 'failedToFetchReferralDetails',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `1. Give this code to your friends`
+  String get referralStep1 {
+    return Intl.message(
+      '1. Give this code to your friends',
+      name: 'referralStep1',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `2. They sign up for a paid plan`
+  String get referralStep2 {
+    return Intl.message(
+      '2. They sign up for a paid plan',
+      name: 'referralStep2',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `3. Both of you get {storageInGB} GB* free`
+  String referralStep3(Object storageInGB) {
+    return Intl.message(
+      '3. Both of you get $storageInGB GB* free',
+      name: 'referralStep3',
+      desc: '',
+      args: [storageInGB],
+    );
+  }
+
+  /// `Referrals are currently paused`
+  String get referralsAreCurrentlyPaused {
+    return Intl.message(
+      'Referrals are currently paused',
+      name: 'referralsAreCurrentlyPaused',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `* You can at max double your storage`
+  String get youCanAtMaxDoubleYourStorage {
+    return Intl.message(
+      '* You can at max double your storage',
+      name: 'youCanAtMaxDoubleYourStorage',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `{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) {
+    return Intl.select(
+      isFamilyMember,
+      {
+        'true': 'Your family has claimed $storageAmountInGb Gb so far',
+        'false': 'You have claimed $storageAmountInGb Gb so far',
+      },
+      name: 'claimedStorageSoFar',
+      desc: '',
+      args: [isFamilyMember, storageAmountInGb],
+    );
+  }
+
+  /// `FAQ`
+  String get faq {
+    return Intl.message(
+      'FAQ',
+      name: 'faq',
+      desc: '',
+      args: [],
+    );
+  }
 }
 
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {

+ 23 - 1
lib/l10n/intl_en.arb

@@ -297,5 +297,27 @@
   "claimMore": "Claim more!",
   "theyAlsoGetXGb": "They also get {storageAmountInGB} GB",
   "freeStorageOnReferralSuccess": "{storageAmountInGB} GB each time someone signs up for a paid plan and applies your code",
-  "shareTextReferralCode": "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"
+  "shareTextReferralCode": "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",
+  "claimFreeStorage": "Claim free storage",
+  "inviteYourFriends": "Invite your friends",
+  "failedToFetchReferralDetails": "Unable to fetch referral details. Please try again later.",
+  "referralStep1": "1. Give this code to your friends",
+  "referralStep2": "2. They sign up for a paid plan",
+  "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": {
+    "placeholders": {
+      "storageAmountInGb": {
+        "type": "int",
+        "example": "10"
+      },
+      "isFamilyMember": {
+        "type": "bool",
+        "example": "true"
+      }
+    }
+  },
+  "faq": "FAQ"
 }

+ 32 - 26
lib/ui/growth/referral_screen.dart

@@ -1,4 +1,5 @@
 import "package:flutter/material.dart";
+import "package:photos/generated/l10n.dart";
 import "package:photos/models/api/storage_bonus/storage_bonus.dart";
 import "package:photos/models/user_details.dart";
 import "package:photos/services/storage_bonus_service.dart";
@@ -53,10 +54,10 @@ class _ReferralScreenState extends State<ReferralScreen> {
         primary: false,
         slivers: <Widget>[
           TitleBarWidget(
-            flexibleSpaceTitle: const TitleBarTitleWidget(
-              title: "Claim free storage",
+            flexibleSpaceTitle: TitleBarTitleWidget(
+              title: S.of(context).claimFreeStorage,
             ),
-            flexibleSpaceCaption: "Invite your friends",
+            flexibleSpaceCaption: S.of(context).inviteYourFriends,
             actionIcons: [
               IconButtonWidget(
                 icon: Icons.close_outlined,
@@ -84,11 +85,11 @@ class _ReferralScreenState extends State<ReferralScreen> {
                           notifyParent: _safeUIUpdate,
                         );
                       } else if (snapshot.hasError) {
-                        return const Center(
+                        return Center(
                           child: Padding(
-                            padding: EdgeInsets.all(24.0),
+                            padding: const EdgeInsets.all(24.0),
                             child: Text(
-                              "Unable to fetch referral details. Please try again later.",
+                              S.of(context).failedToFetchReferralDetails,
                             ),
                           ),
                         );
@@ -134,7 +135,10 @@ class ReferralWidget extends StatelessWidget {
             ? InkWell(
                 onTap: () {
                   shareText(
-                    "ente referral code: ${referralView.code} \n\nApply it in Settings → General → Referrals to get 10 GB free after you signup for a paid plan\n\nhttps://ente.io",
+                    S.of(context).shareTextReferralCode(
+                          referralView.code,
+                          referralView.planInfo.storageInGB,
+                        ),
                   );
                 },
                 child: Container(
@@ -154,20 +158,20 @@ class ReferralWidget extends StatelessWidget {
                     child: Column(
                       crossAxisAlignment: CrossAxisAlignment.start,
                       children: [
-                        const Text(
-                          "1. Give this code to your "
-                          "friends",
+                        Text(
+                          S.of(context).referralStep1,
                         ),
                         const SizedBox(height: 12),
                         ReferralCodeWidget(referralView.code),
                         const SizedBox(height: 12),
-                        const Text(
-                          "2. They sign up for a paid plan",
+                        Text(
+                          S.of(context).referralStep2,
                         ),
                         const SizedBox(height: 12),
                         Text(
-                          "3. Both of you get ${referralView.planInfo.storageInGB} "
-                          "GB* free",
+                          S
+                              .of(context)
+                              .referralStep3(referralView.planInfo.storageInGB),
                         ),
                       ],
                     ),
@@ -186,7 +190,7 @@ class ReferralWidget extends StatelessWidget {
                       ),
                       const SizedBox(height: 12),
                       Text(
-                        "Referrals are currently paused",
+                        S.of(context).referralsAreCurrentlyPaused,
                         style: textStyle.small
                             .copyWith(color: colorScheme.textFaint),
                       ),
@@ -197,7 +201,7 @@ class ReferralWidget extends StatelessWidget {
         const SizedBox(height: 4),
         isReferralEnabled
             ? Text(
-                "* You can at max double your storage",
+                S.of(context).youCanAtMaxDoubleYourStorage,
                 style: textStyle.mini.copyWith(
                   color: colorScheme.textMuted,
                 ),
@@ -207,8 +211,8 @@ class ReferralWidget extends StatelessWidget {
         const SizedBox(height: 24),
         referralView.enableApplyCode
             ? MenuItemWidget(
-                captionedTextWidget: const CaptionedTextWidget(
-                  title: "Apply code",
+                captionedTextWidget: CaptionedTextWidget(
+                  title: S.of(context).applyCodeTitle,
                 ),
                 menuItemColor: colorScheme.fillFaint,
                 trailingWidget: Icon(
@@ -234,8 +238,8 @@ class ReferralWidget extends StatelessWidget {
               )
             : const SizedBox.shrink(),
         MenuItemWidget(
-          captionedTextWidget: const CaptionedTextWidget(
-            title: "FAQ",
+          captionedTextWidget: CaptionedTextWidget(
+            title: S.of(context).faq,
           ),
           menuItemColor: colorScheme.fillFaint,
           trailingWidget: Icon(
@@ -248,8 +252,8 @@ class ReferralWidget extends StatelessWidget {
           onTap: () async {
             routeToPage(
               context,
-              const WebPage(
-                "FAQ",
+              WebPage(
+                S.of(context).faq,
                 "https://ente.io/faq/general/referral-program",
               ),
             );
@@ -262,16 +266,18 @@ class ReferralWidget extends StatelessWidget {
             vertical: 6.0,
           ),
           child: Text(
-            "${referralView.isFamilyMember ? 'Your family has' : 'You have'} claimed "
-            "${convertBytesToAbsoluteGBs(referralView.claimedStorage)} GB so far",
+            S.of(context).claimedStorageSoFar(
+                  referralView.isFamilyMember,
+                  convertBytesToAbsoluteGBs(referralView.claimedStorage),
+                ),
             style: textStyle.small.copyWith(
               color: colorScheme.textMuted,
             ),
           ),
         ),
         MenuItemWidget(
-          captionedTextWidget: const CaptionedTextWidget(
-            title: "Details",
+          captionedTextWidget: CaptionedTextWidget(
+            title: S.of(context).details,
           ),
           menuItemColor: colorScheme.fillFaint,
           trailingWidget: Icon(