ソースを参照

Merge strings

Neeraj Gupta 2 年 前
コミット
fd95485147

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

@@ -225,7 +225,6 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Allow downloads"),
             MessageLookupByLibrary.simpleMessage("Allow downloads"),
         "allowPeopleToAddPhotos":
         "allowPeopleToAddPhotos":
             MessageLookupByLibrary.simpleMessage("Allow people to add photos"),
             MessageLookupByLibrary.simpleMessage("Allow people to add photos"),
-        "and": MessageLookupByLibrary.simpleMessage("and"),
         "androidIosWebDesktop":
         "androidIosWebDesktop":
             MessageLookupByLibrary.simpleMessage("Android, iOS, Web, Desktop"),
             MessageLookupByLibrary.simpleMessage("Android, iOS, Web, Desktop"),
         "appleId": MessageLookupByLibrary.simpleMessage("Apple ID"),
         "appleId": MessageLookupByLibrary.simpleMessage("Apple ID"),
@@ -295,8 +294,6 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Backup settings"),
             MessageLookupByLibrary.simpleMessage("Backup settings"),
         "backupVideos": MessageLookupByLibrary.simpleMessage("Backup videos"),
         "backupVideos": MessageLookupByLibrary.simpleMessage("Backup videos"),
         "blog": MessageLookupByLibrary.simpleMessage("Blog"),
         "blog": MessageLookupByLibrary.simpleMessage("Blog"),
-        "byClickingLogInIAgreeToThe": MessageLookupByLibrary.simpleMessage(
-            "By clicking log in, I agree to the"),
         "cachedData": MessageLookupByLibrary.simpleMessage("Cached data"),
         "cachedData": MessageLookupByLibrary.simpleMessage("Cached data"),
         "calculating": MessageLookupByLibrary.simpleMessage("Calculating..."),
         "calculating": MessageLookupByLibrary.simpleMessage("Calculating..."),
         "canNotUploadToAlbumsOwnedByOthers":
         "canNotUploadToAlbumsOwnedByOthers":
@@ -685,6 +682,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "lockscreen": MessageLookupByLibrary.simpleMessage("Lockscreen"),
         "lockscreen": MessageLookupByLibrary.simpleMessage("Lockscreen"),
         "logInLabel": MessageLookupByLibrary.simpleMessage("Log in"),
         "logInLabel": MessageLookupByLibrary.simpleMessage("Log in"),
         "loggingOut": MessageLookupByLibrary.simpleMessage("Logging out..."),
         "loggingOut": MessageLookupByLibrary.simpleMessage("Logging out..."),
+        "loginTerms": MessageLookupByLibrary.simpleMessage(
+            "By clicking log in, I agree to the <u-terms>terms of service</u-terms> and <u-policy>privacy policy</u-policy>"),
         "logout": MessageLookupByLibrary.simpleMessage("Logout"),
         "logout": MessageLookupByLibrary.simpleMessage("Logout"),
         "logsDialogBody": MessageLookupByLibrary.simpleMessage(
         "logsDialogBody": MessageLookupByLibrary.simpleMessage(
             "This will send across logs to help us debug your issue. Please note that file names will be included to help track issues with specific files."),
             "This will send across logs to help us debug your issue. Please note that file names will be included to help track issues with specific files."),

+ 5 - 17
lib/generated/l10n.dart

@@ -842,17 +842,6 @@ class S {
     );
     );
   }
   }
 
 
-  /// `and`
-  String get and {
-    return Intl.message(
-      'and',
-      name: 'and',
-      desc:
-          'Separator used in sentences like \'I agree to the terms of service and privacy policy.\'',
-      args: [],
-    );
-  }
-
   /// `terms of service`
   /// `terms of service`
   String get termsOfService {
   String get termsOfService {
     return Intl.message(
     return Intl.message(
@@ -873,13 +862,12 @@ class S {
     );
     );
   }
   }
 
 
-  /// `By clicking log in, I agree to the`
-  String get byClickingLogInIAgreeToThe {
+  /// `By clicking log in, I agree to the <u-terms>terms of service</u-terms> and <u-policy>privacy policy</u-policy>`
+  String get loginTerms {
     return Intl.message(
     return Intl.message(
-      'By clicking log in, I agree to the',
-      name: 'byClickingLogInIAgreeToThe',
-      desc:
-          'This text is part the sentence \'By clicking log in, I agree to the terms of service and privacy policy\'',
+      'By clicking log in, I agree to the <u-terms>terms of service</u-terms> and <u-policy>privacy policy</u-policy>',
+      name: 'loginTerms',
+      desc: '',
       args: [],
       args: [],
     );
     );
   }
   }

+ 1 - 8
lib/l10n/intl_en.arb

@@ -95,16 +95,9 @@
     "description": "Note: there's a trailing space. This text is part the sentence 'I agree to the terms of service and privacy policy.'"
     "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",
   "privacyPolicy": "privacy policy",
-  "and": "and",
-  "@and": {
-    "description": "Separator used in sentences like 'I agree to the terms of service and privacy policy.'"
-  },
   "termsOfService": "terms of service",
   "termsOfService": "terms of service",
   "logInLabel": "Log in",
   "logInLabel": "Log in",
-  "byClickingLogInIAgreeToThe": "By clicking log in, I agree to the",
-  "@byClickingLogInIAgreeToThe": {
-    "description": "This text is part the sentence 'By clicking log in, I agree to the terms of service and privacy policy'"
-  },
+  "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",
   "changeEmail": "Change email",
   "enterYourPassword": "Enter your password",
   "enterYourPassword": "Enter your password",
   "welcomeBack": "Welcome back!",
   "welcomeBack": "Welcome back!",

+ 42 - 53
lib/ui/account/login_page.dart

@@ -1,5 +1,4 @@
 import 'package:email_validator/email_validator.dart';
 import 'package:email_validator/email_validator.dart';
-import 'package:flutter/gestures.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/core/configuration.dart';
 import "package:photos/generated/l10n.dart";
 import "package:photos/generated/l10n.dart";
@@ -7,6 +6,7 @@ import "package:photos/l10n/l10n.dart";
 import 'package:photos/services/user_service.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/common/dynamic_fab.dart';
 import 'package:photos/ui/common/dynamic_fab.dart';
 import 'package:photos/ui/common/web_page.dart';
 import 'package:photos/ui/common/web_page.dart';
+import "package:styled_text/styled_text.dart";
 
 
 class LoginPage extends StatefulWidget {
 class LoginPage extends StatefulWidget {
   const LoginPage({Key? key}) : super(key: key);
   const LoginPage({Key? key}) : super(key: key);
@@ -142,63 +142,52 @@ class _LoginPageState extends State<LoginPage> {
                     children: [
                     children: [
                       Expanded(
                       Expanded(
                         flex: 5,
                         flex: 5,
-                        child: RichText(
-                          text: TextSpan(
-                            style: Theme.of(context)
-                                .textTheme
-                                .subtitle1!
-                                .copyWith(fontSize: 12),
-                            children: [
-                              TextSpan(
-                                text: S.of(context).byClickingLogInIAgreeToThe +
-                                    " ",
+                        child: StyledText(
+                          text: S.of(context).loginTerms,
+                          style: Theme.of(context)
+                              .textTheme
+                              .subtitle1!
+                              .copyWith(fontSize: 12),
+                          tags: {
+                            'u-terms': StyledTextActionTag(
+                              (String? text, Map<String?, String?> attrs) => {
+                                Navigator.of(context).push(
+                                  MaterialPageRoute(
+                                    builder: (BuildContext context) {
+                                      return WebPage(
+                                        S.of(context).termsOfServicesTitle,
+                                        "https://ente.io/terms",
+                                      );
+                                    },
+                                  ),
+                                )
+                              },
+                              style: const TextStyle(
+                                decoration: TextDecoration.underline,
                               ),
                               ),
-                              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",
-                                          );
-                                        },
-                                      ),
-                                    );
-                                  },
+                            ),
+                            'u-policy': StyledTextActionTag(
+                              (String? text, Map<String?, String?> attrs) => {
+                                Navigator.of(context).push(
+                                  MaterialPageRoute(
+                                    builder: (BuildContext context) {
+                                      return WebPage(
+                                        S.of(context).privacyPolicyTitle,
+                                        "https://ente.io/privacy",
+                                      );
+                                    },
+                                  ),
+                                )
+                              },
+                              style: const TextStyle(
+                                decoration: TextDecoration.underline,
                               ),
                               ),
-                              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",
-                                          );
-                                        },
-                                      ),
-                                    );
-                                  },
-                              ),
-                            ],
-                          ),
-                          textAlign: TextAlign.left,
+                            )
+                          },
                         ),
                         ),
                       ),
                       ),
                       Expanded(
                       Expanded(
-                        flex: 2,
+                        flex: 1,
                         child: Container(),
                         child: Container(),
                       )
                       )
                     ],
                     ],