l10n: extract recovery_page strings
This commit is contained in:
parent
31850533cd
commit
fd07cbd053
|
@ -38,6 +38,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||||
"createAccount": MessageLookupByLibrary.simpleMessage("Create account"),
|
"createAccount": MessageLookupByLibrary.simpleMessage("Create account"),
|
||||||
"createNewAccount":
|
"createNewAccount":
|
||||||
MessageLookupByLibrary.simpleMessage("Create new account"),
|
MessageLookupByLibrary.simpleMessage("Create new account"),
|
||||||
|
"decrypting": MessageLookupByLibrary.simpleMessage("Decrypting..."),
|
||||||
"deleteAccount": MessageLookupByLibrary.simpleMessage("Delete account"),
|
"deleteAccount": MessageLookupByLibrary.simpleMessage("Delete account"),
|
||||||
"deleteAccountFeedbackPrompt": MessageLookupByLibrary.simpleMessage(
|
"deleteAccountFeedbackPrompt": MessageLookupByLibrary.simpleMessage(
|
||||||
"We are sorry to see you go. Please share your feedback to help us improve."),
|
"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."),
|
"Please enter a valid email address."),
|
||||||
"enterYourEmailAddress":
|
"enterYourEmailAddress":
|
||||||
MessageLookupByLibrary.simpleMessage("Enter your email address"),
|
MessageLookupByLibrary.simpleMessage("Enter your email address"),
|
||||||
|
"enterYourRecoveryKey":
|
||||||
|
MessageLookupByLibrary.simpleMessage("Enter your recovery key"),
|
||||||
"feedback": MessageLookupByLibrary.simpleMessage("Feedback"),
|
"feedback": MessageLookupByLibrary.simpleMessage("Feedback"),
|
||||||
|
"forgotPassword":
|
||||||
|
MessageLookupByLibrary.simpleMessage("Forgot password"),
|
||||||
"fromYourRegisteredEmailAddress": MessageLookupByLibrary.simpleMessage(
|
"fromYourRegisteredEmailAddress": MessageLookupByLibrary.simpleMessage(
|
||||||
"from your registered email address."),
|
"from your registered email address."),
|
||||||
|
"incorrectRecoveryKeyBody": MessageLookupByLibrary.simpleMessage(
|
||||||
|
"The recovery key you entered is incorrect"),
|
||||||
|
"incorrectRecoveryKeyTitle":
|
||||||
|
MessageLookupByLibrary.simpleMessage("Incorrect recovery key"),
|
||||||
"invalidEmailAddress":
|
"invalidEmailAddress":
|
||||||
MessageLookupByLibrary.simpleMessage("Invalid email address"),
|
MessageLookupByLibrary.simpleMessage("Invalid email address"),
|
||||||
"kindlyHelpUsWithThisInformation": MessageLookupByLibrary.simpleMessage(
|
"kindlyHelpUsWithThisInformation": MessageLookupByLibrary.simpleMessage(
|
||||||
"Kindly help us with this information"),
|
"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"),
|
"ok": MessageLookupByLibrary.simpleMessage("Ok"),
|
||||||
"oops": MessageLookupByLibrary.simpleMessage("Oops"),
|
"oops": MessageLookupByLibrary.simpleMessage("Oops"),
|
||||||
"password": MessageLookupByLibrary.simpleMessage("Password"),
|
"password": MessageLookupByLibrary.simpleMessage("Password"),
|
||||||
"pleaseSendAnEmailTo":
|
"pleaseSendAnEmailTo":
|
||||||
MessageLookupByLibrary.simpleMessage("Please send an email to"),
|
MessageLookupByLibrary.simpleMessage("Please send an email to"),
|
||||||
|
"recoverButton": MessageLookupByLibrary.simpleMessage("Recover"),
|
||||||
|
"recoverySuccessful":
|
||||||
|
MessageLookupByLibrary.simpleMessage("Recovery successful!"),
|
||||||
"selectReason": MessageLookupByLibrary.simpleMessage("Select reason"),
|
"selectReason": MessageLookupByLibrary.simpleMessage("Select reason"),
|
||||||
"sendEmail": MessageLookupByLibrary.simpleMessage("Send email"),
|
"sendEmail": MessageLookupByLibrary.simpleMessage("Send email"),
|
||||||
"somethingWentWrongPleaseTryAgain":
|
"somethingWentWrongPleaseTryAgain":
|
||||||
MessageLookupByLibrary.simpleMessage(
|
MessageLookupByLibrary.simpleMessage(
|
||||||
"Something went wrong, please try again"),
|
"Something went wrong, please try again"),
|
||||||
|
"sorry": MessageLookupByLibrary.simpleMessage("Sorry"),
|
||||||
"terminate": MessageLookupByLibrary.simpleMessage("Terminate"),
|
"terminate": MessageLookupByLibrary.simpleMessage("Terminate"),
|
||||||
"terminateSession":
|
"terminateSession":
|
||||||
MessageLookupByLibrary.simpleMessage("Terminate session?"),
|
MessageLookupByLibrary.simpleMessage("Terminate session?"),
|
||||||
|
|
|
@ -441,6 +441,106 @@ class S {
|
||||||
args: [],
|
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> {
|
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
|
||||||
|
|
|
@ -43,5 +43,15 @@
|
||||||
"thisWillLogYouOutOfTheFollowingDevice": "This will log you out of the following device:",
|
"thisWillLogYouOutOfTheFollowingDevice": "This will log you out of the following device:",
|
||||||
"terminateSession": "Terminate session?",
|
"terminateSession": "Terminate session?",
|
||||||
"terminate": "Terminate",
|
"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"
|
||||||
}
|
}
|
|
@ -2,6 +2,7 @@ import 'dart:ui';
|
||||||
|
|
||||||
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/ui/account/password_entry_page.dart';
|
import 'package:photos/ui/account/password_entry_page.dart';
|
||||||
import 'package:photos/ui/common/dynamic_fab.dart';
|
import 'package:photos/ui/common/dynamic_fab.dart';
|
||||||
import 'package:photos/utils/dialog_util.dart';
|
import 'package:photos/utils/dialog_util.dart';
|
||||||
|
@ -43,15 +44,16 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
||||||
floatingActionButton: DynamicFAB(
|
floatingActionButton: DynamicFAB(
|
||||||
isKeypadOpen: isKeypadOpen,
|
isKeypadOpen: isKeypadOpen,
|
||||||
isFormValid: _recoveryKey.text.isNotEmpty,
|
isFormValid: _recoveryKey.text.isNotEmpty,
|
||||||
buttonText: 'Recover',
|
buttonText: S.of(context).recoverButton,
|
||||||
onPressedFunction: () async {
|
onPressedFunction: () async {
|
||||||
FocusScope.of(context).unfocus();
|
FocusScope.of(context).unfocus();
|
||||||
final dialog = createProgressDialog(context, "Decrypting...");
|
final dialog =
|
||||||
|
createProgressDialog(context, S.of(context).decrypting);
|
||||||
await dialog.show();
|
await dialog.show();
|
||||||
try {
|
try {
|
||||||
await Configuration.instance.recover(_recoveryKey.text.trim());
|
await Configuration.instance.recover(_recoveryKey.text.trim());
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
showShortToast(context, "Recovery successful!");
|
showShortToast(context, S.of(context).recoverySuccessful);
|
||||||
Navigator.of(context).pushReplacement(
|
Navigator.of(context).pushReplacement(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -66,11 +68,15 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
String errMessage = "The recovery key you entered is incorrect";
|
String errMessage = S.of(context).incorrectRecoveryKeyBody;
|
||||||
if (e is AssertionError) {
|
if (e is AssertionError) {
|
||||||
errMessage = '$errMessage : ${e.message}';
|
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:
|
padding:
|
||||||
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
|
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Forgot password',
|
S.of(context).forgotPassword,
|
||||||
style: Theme.of(context).textTheme.headline4,
|
style: Theme.of(context).textTheme.headline4,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -94,7 +100,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
filled: true,
|
filled: true,
|
||||||
hintText: "Enter your recovery key",
|
hintText: S.of(context).enterYourRecoveryKey,
|
||||||
contentPadding: const EdgeInsets.all(20),
|
contentPadding: const EdgeInsets.all(20),
|
||||||
border: UnderlineInputBorder(
|
border: UnderlineInputBorder(
|
||||||
borderSide: BorderSide.none,
|
borderSide: BorderSide.none,
|
||||||
|
@ -128,15 +134,15 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
"Sorry",
|
S.of(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).noRecoveryKeyNoDecryption,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
"No recovery key?",
|
S.of(context).noRecoveryKey,
|
||||||
style:
|
style:
|
||||||
Theme.of(context).textTheme.subtitle1!.copyWith(
|
Theme.of(context).textTheme.subtitle1!.copyWith(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
|
|
Loading…
Reference in a new issue