Explorar o código

l10n: extract recovery_page strings

Neeraj Gupta %!s(int64=2) %!d(string=hai) anos
pai
achega
fd07cbd053

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

@@ -38,6 +38,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "createAccount": MessageLookupByLibrary.simpleMessage("Create account"),
         "createNewAccount":
             MessageLookupByLibrary.simpleMessage("Create new account"),
+        "decrypting": MessageLookupByLibrary.simpleMessage("Decrypting..."),
         "deleteAccount": MessageLookupByLibrary.simpleMessage("Delete account"),
         "deleteAccountFeedbackPrompt": MessageLookupByLibrary.simpleMessage(
             "We are sorry to see you go. Please share your feedback to help us improve."),
@@ -60,23 +61,39 @@ class MessageLookup extends MessageLookupByLibrary {
             "Please enter a valid email address."),
         "enterYourEmailAddress":
             MessageLookupByLibrary.simpleMessage("Enter your email address"),
+        "enterYourRecoveryKey":
+            MessageLookupByLibrary.simpleMessage("Enter your recovery key"),
         "feedback": MessageLookupByLibrary.simpleMessage("Feedback"),
+        "forgotPassword":
+            MessageLookupByLibrary.simpleMessage("Forgot password"),
         "fromYourRegisteredEmailAddress": MessageLookupByLibrary.simpleMessage(
             "from your registered email address."),
+        "incorrectRecoveryKeyBody": MessageLookupByLibrary.simpleMessage(
+            "The recovery key you entered is incorrect"),
+        "incorrectRecoveryKeyTitle":
+            MessageLookupByLibrary.simpleMessage("Incorrect recovery key"),
         "invalidEmailAddress":
             MessageLookupByLibrary.simpleMessage("Invalid email address"),
         "kindlyHelpUsWithThisInformation": MessageLookupByLibrary.simpleMessage(
             "Kindly help us with this information"),
+        "noRecoveryKey":
+            MessageLookupByLibrary.simpleMessage("No recovery key?"),
+        "noRecoveryKeyNoDecryption": MessageLookupByLibrary.simpleMessage(
+            "Due to the nature of our end-to-end encryption protocol, your data cannot be decrypted without your password or recovery key"),
         "ok": MessageLookupByLibrary.simpleMessage("Ok"),
         "oops": MessageLookupByLibrary.simpleMessage("Oops"),
         "password": MessageLookupByLibrary.simpleMessage("Password"),
         "pleaseSendAnEmailTo":
             MessageLookupByLibrary.simpleMessage("Please send an email to"),
+        "recoverButton": MessageLookupByLibrary.simpleMessage("Recover"),
+        "recoverySuccessful":
+            MessageLookupByLibrary.simpleMessage("Recovery successful!"),
         "selectReason": MessageLookupByLibrary.simpleMessage("Select reason"),
         "sendEmail": MessageLookupByLibrary.simpleMessage("Send email"),
         "somethingWentWrongPleaseTryAgain":
             MessageLookupByLibrary.simpleMessage(
                 "Something went wrong, please try again"),
+        "sorry": MessageLookupByLibrary.simpleMessage("Sorry"),
         "terminate": MessageLookupByLibrary.simpleMessage("Terminate"),
         "terminateSession":
             MessageLookupByLibrary.simpleMessage("Terminate session?"),

+ 100 - 0
lib/generated/l10n.dart

@@ -441,6 +441,106 @@ class S {
       args: [],
     );
   }
+
+  /// `Recover`
+  String get recoverButton {
+    return Intl.message(
+      'Recover',
+      name: 'recoverButton',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Recovery successful!`
+  String get recoverySuccessful {
+    return Intl.message(
+      'Recovery successful!',
+      name: 'recoverySuccessful',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Decrypting...`
+  String get decrypting {
+    return Intl.message(
+      'Decrypting...',
+      name: 'decrypting',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Incorrect recovery key`
+  String get incorrectRecoveryKeyTitle {
+    return Intl.message(
+      'Incorrect recovery key',
+      name: 'incorrectRecoveryKeyTitle',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `The recovery key you entered is incorrect`
+  String get incorrectRecoveryKeyBody {
+    return Intl.message(
+      'The recovery key you entered is incorrect',
+      name: 'incorrectRecoveryKeyBody',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Forgot password`
+  String get forgotPassword {
+    return Intl.message(
+      'Forgot password',
+      name: 'forgotPassword',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Enter your recovery key`
+  String get enterYourRecoveryKey {
+    return Intl.message(
+      'Enter your recovery key',
+      name: 'enterYourRecoveryKey',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `No recovery key?`
+  String get noRecoveryKey {
+    return Intl.message(
+      'No recovery key?',
+      name: 'noRecoveryKey',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Sorry`
+  String get sorry {
+    return Intl.message(
+      'Sorry',
+      name: 'sorry',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Due to the nature of our end-to-end encryption protocol, your data cannot be decrypted without your password or recovery key`
+  String get noRecoveryKeyNoDecryption {
+    return Intl.message(
+      'Due to the nature of our end-to-end encryption protocol, your data cannot be decrypted without your password or recovery key',
+      name: 'noRecoveryKeyNoDecryption',
+      desc: '',
+      args: [],
+    );
+  }
 }
 
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {

+ 11 - 1
lib/l10n/intl_en.arb

@@ -43,5 +43,15 @@
   "thisWillLogYouOutOfTheFollowingDevice": "This will log you out of the following device:",
   "terminateSession": "Terminate session?",
   "terminate": "Terminate",
-  "thisDevice": "This device"
+  "thisDevice": "This device",
+  "recoverButton": "Recover",
+  "recoverySuccessful": "Recovery successful!",
+  "decrypting": "Decrypting...",
+  "incorrectRecoveryKeyTitle": "Incorrect recovery key",
+  "incorrectRecoveryKeyBody": "The recovery key you entered is incorrect",
+  "forgotPassword": "Forgot password",
+  "enterYourRecoveryKey": "Enter your recovery key",
+  "noRecoveryKey": "No recovery key?",
+  "sorry": "Sorry",
+  "noRecoveryKeyNoDecryption": "Due to the nature of our end-to-end encryption protocol, your data cannot be decrypted without your password or recovery key"
 }

+ 16 - 10
lib/ui/account/recovery_page.dart

@@ -2,6 +2,7 @@ import 'dart:ui';
 
 import 'package:flutter/material.dart';
 import 'package:photos/core/configuration.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/ui/account/password_entry_page.dart';
 import 'package:photos/ui/common/dynamic_fab.dart';
 import 'package:photos/utils/dialog_util.dart';
@@ -43,15 +44,16 @@ class _RecoveryPageState extends State<RecoveryPage> {
       floatingActionButton: DynamicFAB(
         isKeypadOpen: isKeypadOpen,
         isFormValid: _recoveryKey.text.isNotEmpty,
-        buttonText: 'Recover',
+        buttonText: S.of(context).recoverButton,
         onPressedFunction: () async {
           FocusScope.of(context).unfocus();
-          final dialog = createProgressDialog(context, "Decrypting...");
+          final dialog =
+              createProgressDialog(context, S.of(context).decrypting);
           await dialog.show();
           try {
             await Configuration.instance.recover(_recoveryKey.text.trim());
             await dialog.hide();
-            showShortToast(context, "Recovery successful!");
+            showShortToast(context, S.of(context).recoverySuccessful);
             Navigator.of(context).pushReplacement(
               MaterialPageRoute(
                 builder: (BuildContext context) {
@@ -66,11 +68,15 @@ class _RecoveryPageState extends State<RecoveryPage> {
             );
           } catch (e) {
             await dialog.hide();
-            String errMessage = "The recovery key you entered is incorrect";
+            String errMessage = S.of(context).incorrectRecoveryKeyBody;
             if (e is AssertionError) {
               errMessage = '$errMessage : ${e.message}';
             }
-            showErrorDialog(context, "Incorrect recovery key", errMessage);
+            showErrorDialog(
+              context,
+              S.of(context).incorrectRecoveryKeyTitle,
+              errMessage,
+            );
           }
         },
       ),
@@ -85,7 +91,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
                   padding:
                       const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
                   child: Text(
-                    'Forgot password',
+                    S.of(context).forgotPassword,
                     style: Theme.of(context).textTheme.headline4,
                   ),
                 ),
@@ -94,7 +100,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
                   child: TextFormField(
                     decoration: InputDecoration(
                       filled: true,
-                      hintText: "Enter your recovery key",
+                      hintText: S.of(context).enterYourRecoveryKey,
                       contentPadding: const EdgeInsets.all(20),
                       border: UnderlineInputBorder(
                         borderSide: BorderSide.none,
@@ -128,15 +134,15 @@ class _RecoveryPageState extends State<RecoveryPage> {
                       onTap: () {
                         showErrorDialog(
                           context,
-                          "Sorry",
-                          "Due to the nature of our end-to-end encryption protocol, your data cannot be decrypted without your password or recovery key",
+                          S.of(context).sorry,
+                          S.of(context).noRecoveryKeyNoDecryption,
                         );
                       },
                       child: Container(
                         padding: const EdgeInsets.symmetric(horizontal: 20),
                         child: Center(
                           child: Text(
-                            "No recovery key?",
+                            S.of(context).noRecoveryKey,
                             style:
                                 Theme.of(context).textTheme.subtitle1!.copyWith(
                                       fontSize: 14,