Ver código fonte

l10n: Merge strings

Neeraj Gupta 2 anos atrás
pai
commit
6d429f4523

+ 2 - 11
lib/generated/intl/messages_en.dart

@@ -184,10 +184,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "account": MessageLookupByLibrary.simpleMessage("Account"),
         "accountWelcomeBack":
             MessageLookupByLibrary.simpleMessage("Welcome back!"),
-        "ackPasswordLostWarningPart1": MessageLookupByLibrary.simpleMessage(
-            "I understand that if I lose my password, I may lose my data since my data is "),
-        "ackPasswordLostWarningPart2":
-            MessageLookupByLibrary.simpleMessage(" with ente"),
+        "ackPasswordLostWarning": MessageLookupByLibrary.simpleMessage(
+            "I understand that if I lose my password, I may lose my data since my data is <underline>end-to-end encrypted</underline>."),
         "activeSessions":
             MessageLookupByLibrary.simpleMessage("Active sessions"),
         "addANewEmail": MessageLookupByLibrary.simpleMessage("Add a new email"),
@@ -498,8 +496,6 @@ class MessageLookup extends MessageLookupByLibrary {
         "encryption": MessageLookupByLibrary.simpleMessage("Encryption"),
         "encryptionKeys":
             MessageLookupByLibrary.simpleMessage("Encryption keys"),
-        "endToEndEncrypted":
-            MessageLookupByLibrary.simpleMessage("end-to-end encrypted"),
         "endtoendEncryptedByDefault": MessageLookupByLibrary.simpleMessage(
             "End-to-end encrypted by default"),
         "enteCanEncryptAndPreserveFilesOnlyIfYouGrant":
@@ -805,7 +801,6 @@ class MessageLookup extends MessageLookupByLibrary {
         "pressAndHoldToPlayVideo": MessageLookupByLibrary.simpleMessage(
             "Press and hold to play video"),
         "privacy": MessageLookupByLibrary.simpleMessage("Privacy"),
-        "privacyPolicy": MessageLookupByLibrary.simpleMessage("privacy policy"),
         "privacyPolicyTitle":
             MessageLookupByLibrary.simpleMessage("Privacy Policy"),
         "privateBackups":
@@ -1041,10 +1036,6 @@ class MessageLookup extends MessageLookupByLibrary {
         "terminateSession":
             MessageLookupByLibrary.simpleMessage("Terminate session?"),
         "terms": MessageLookupByLibrary.simpleMessage("Terms"),
-        "termsAgreePart1":
-            MessageLookupByLibrary.simpleMessage("I agree to the "),
-        "termsOfService":
-            MessageLookupByLibrary.simpleMessage("terms of service"),
         "termsOfServicesTitle": MessageLookupByLibrary.simpleMessage("Terms"),
         "thankYou": MessageLookupByLibrary.simpleMessage("Thank you"),
         "thankYouForSubscribing":

+ 4 - 56
lib/generated/l10n.dart

@@ -770,37 +770,16 @@ class S {
     );
   }
 
-  /// `I understand that if I lose my password, I may lose my data since my data is `
-  String get ackPasswordLostWarningPart1 {
+  /// `I understand that if I lose my password, I may lose my data since my data is <underline>end-to-end encrypted</underline>.`
+  String get ackPasswordLostWarning {
     return Intl.message(
-      'I understand that if I lose my password, I may lose my data since my data is ',
-      name: 'ackPasswordLostWarningPart1',
+      'I understand that if I lose my password, I may lose my data since my data is <underline>end-to-end encrypted</underline>.',
+      name: 'ackPasswordLostWarning',
       desc: '',
       args: [],
     );
   }
 
-  /// `end-to-end encrypted`
-  String get endToEndEncrypted {
-    return Intl.message(
-      'end-to-end encrypted',
-      name: 'endToEndEncrypted',
-      desc: '',
-      args: [],
-    );
-  }
-
-  /// ` with ente`
-  String get ackPasswordLostWarningPart2 {
-    return Intl.message(
-      ' with ente',
-      name: 'ackPasswordLostWarningPart2',
-      desc:
-          'This text is part2 the sentence \'I understand that if I lose my password, I may lose my data since my data is end-to-end encrypted with ente.\'',
-      args: [],
-    );
-  }
-
   /// `Privacy Policy`
   String get privacyPolicyTitle {
     return Intl.message(
@@ -831,37 +810,6 @@ class S {
     );
   }
 
-  /// `I agree to the `
-  String get termsAgreePart1 {
-    return Intl.message(
-      'I agree to the ',
-      name: 'termsAgreePart1',
-      desc:
-          'Note: there\'s a trailing space. This text is part the sentence \'I agree to the terms of service and privacy policy.\'',
-      args: [],
-    );
-  }
-
-  /// `privacy policy`
-  String get privacyPolicy {
-    return Intl.message(
-      'privacy policy',
-      name: 'privacyPolicy',
-      desc: '',
-      args: [],
-    );
-  }
-
-  /// `terms of service`
-  String get termsOfService {
-    return Intl.message(
-      'terms of service',
-      name: 'termsOfService',
-      desc: '',
-      args: [],
-    );
-  }
-
   /// `Log in`
   String get logInLabel {
     return Intl.message(

+ 1 - 12
lib/l10n/intl_en.arb

@@ -82,21 +82,10 @@
   "sorryWeCouldNotGenerateSecureKeysOnThisDevicennplease": "Sorry, we could not generate secure keys on this device.\n\nplease sign up from a different device.",
   "howItWorks": "How it works",
   "encryption": "Encryption",
-  "ackPasswordLostWarningPart1": "I understand that if I lose my password, I may lose my data since my data is ",
-  "endToEndEncrypted": "end-to-end encrypted",
-  "ackPasswordLostWarningPart2": " with ente",
-  "@ackPasswordLostWarningPart2": {
-    "description": "This text is part2 the sentence 'I understand that if I lose my password, I may lose my data since my data is end-to-end encrypted with ente.'"
-  },
+  "ackPasswordLostWarning": "I understand that if I lose my password, I may lose my data since my data is <underline>end-to-end encrypted</underline>.",
   "privacyPolicyTitle": "Privacy Policy",
   "termsOfServicesTitle": "Terms",
   "signUpTerms" : "I agree to the <u-terms>terms of service</u-terms> and <u-policy>privacy policy</u-policy>",
-  "termsAgreePart1": "I agree to the ",
-  "@termsAgreePart1": {
-    "description": "Note: there's a trailing space. This text is part the sentence 'I agree to the terms of service and privacy policy.'"
-  },
-  "privacyPolicy": "privacy policy",
-  "termsOfService": "terms of service",
   "logInLabel": "Log in",
   "loginTerms": "By clicking log in, I agree to the <u-terms>terms of service</u-terms> and <u-policy>privacy policy</u-policy>",
   "changeEmail": "Change email",

+ 22 - 88
lib/ui/account/email_entry_page.dart

@@ -1,5 +1,4 @@
 import 'package:email_validator/email_validator.dart';
-import 'package:flutter/gestures.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:password_strength/password_strength.dart';
@@ -411,59 +410,6 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                 )
               },
             ),
-            // child: RichText(
-            //   text: TextSpan(
-            //     children: [
-            //       TextSpan(
-            //         text: S.of(context).termsAgreePart1,
-            //       ),
-            //       TextSpan(
-            //         text: S.of(context).termsOfService,
-            //         style: const TextStyle(
-            //           decoration: TextDecoration.underline,
-            //         ),
-            //         recognizer: TapGestureRecognizer()
-            //           ..onTap = () {
-            //             Navigator.of(context).push(
-            //               MaterialPageRoute(
-            //                 builder: (BuildContext context) {
-            //                   return WebPage(
-            //                     S.of(context).termsOfServicesTitle,
-            //                     "https://ente.io/terms",
-            //                   );
-            //                 },
-            //               ),
-            //             );
-            //           },
-            //       ),
-            //       TextSpan(text: ' ${S.of(context).and} '),
-            //       TextSpan(
-            //         text: S.of(context).privacyPolicy,
-            //         style: const TextStyle(
-            //           decoration: TextDecoration.underline,
-            //         ),
-            //         recognizer: TapGestureRecognizer()
-            //           ..onTap = () {
-            //             Navigator.of(context).push(
-            //               MaterialPageRoute(
-            //                 builder: (BuildContext context) {
-            //                   return WebPage(
-            //                     S.of(context).privacyPolicyTitle,
-            //                     "https://ente.io/privacy",
-            //                   );
-            //                 },
-            //               ),
-            //             );
-            //           },
-            //       ),
-            //     ],
-            //     style: Theme.of(context)
-            //         .textTheme
-            //         .subtitle1!
-            //         .copyWith(fontSize: 12),
-            //   ),
-            //   textAlign: TextAlign.left,
-            // ),
           ),
         ],
       ),
@@ -490,41 +436,29 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
             },
           ),
           Expanded(
-            child: RichText(
-              text: TextSpan(
-                children: [
-                  TextSpan(
-                    text: S.of(context).ackPasswordLostWarningPart1,
-                  ),
-                  TextSpan(
-                    text: S.of(context).endToEndEncrypted,
-                    style: const TextStyle(
-                      decoration: TextDecoration.underline,
-                    ),
-                    recognizer: TapGestureRecognizer()
-                      ..onTap = () {
-                        Navigator.of(context).push(
-                          MaterialPageRoute(
-                            builder: (BuildContext context) {
-                              return WebPage(
-                                S.of(context).encryption,
-                                "https://ente.io/architecture",
-                              );
-                            },
-                          ),
-                        );
-                      },
-                  ),
-                  TextSpan(
-                    text: " ${S.of(context).ackPasswordLostWarningPart2}",
+            child: StyledText(
+              text: S.of(context).ackPasswordLostWarning,
+              style:
+                  Theme.of(context).textTheme.subtitle1!.copyWith(fontSize: 12),
+              tags: {
+                'underline': StyledTextActionTag(
+                  (String? text, Map<String?, String?> attrs) => {
+                    Navigator.of(context).push(
+                      MaterialPageRoute(
+                        builder: (BuildContext context) {
+                          return WebPage(
+                            S.of(context).encryption,
+                            "https://ente.io/architecture",
+                          );
+                        },
+                      ),
+                    )
+                  },
+                  style: const TextStyle(
+                    decoration: TextDecoration.underline,
                   ),
-                ],
-                style: Theme.of(context)
-                    .textTheme
-                    .subtitle1!
-                    .copyWith(fontSize: 12),
-              ),
-              textAlign: TextAlign.left,
+                ),
+              },
             ),
           ),
         ],