π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Refactor strings
vishnukvmd11289b2b9823
diff --git a/mobile/apps/locker/lib/l10n/app_en.arb b/mobile/apps/locker/lib/l10n/app_en.arbindex 5999755f4a..e57638b09b 100644--- a/mobile/apps/locker/lib/l10n/app_en.arb+++ b/mobile/apps/locker/lib/l10n/app_en.arb@@ -676,6 +676,33 @@}},"locker": "Locker",+ "loginToEnteAccount": "Log in to your Ente account",+ "unlockLockerPaidPlanTitle": "Unlock locker with a paid plan",+ "unlockLockerPaidPlanBody": "Locker is available only to paid customers of Ente Photos. Upgrade to a paid plan from Photos to use Locker",+ "checkoutEntePhotos": "Checkout Ente Photos",+ "noAccountCta": "I don't have an account",+ "featureSaveImportant": "Save your important documents and credentials",+ "featurePassAutomatically": "Pass them on automatically in emergencies",+ "featureShareAnytime": "Share them anytime",+ "emailIdLabel": "Email id",+ "emailIdHint": "Enter your email id",+ "loginPasswordLabel": "Password",+ "loginPasswordHint": "Enter your password",+ "forgotPassword": "Forgot Password?",+ "logInAction": "Log in",+ "dontHaveAccount": "Don't have an account?",+ "signUp": "Sign up",+ "incorrectPassword": "Incorrect Password",+ "pleaseTryAgain": "Please try again",+ "noInternetConnection": "No Internet Connection",+ "checkInternetConnection": "Please check your internet connection and try again",+ "verificationFailedTryAgain": "Verification failed, please try again",+ "recreatePassword": "Recreate password",+ "deviceCannotVerifyPassword": "Your device does not have enough memory to verify your password",+ "useRecoveryKey": "Use recovery key",+ "invalidEmail": "Invalid Email",+ "enterValidEmailFirst": "Please enter a valid email address first",+ "lockerLoginIssueSubject": "Locker Login Issue","unnamed": "Unnamed","collectionLabel": "Collection","areYouSure": "Are you sure?",diff --git a/mobile/apps/locker/lib/l10n/app_localizations.dart b/mobile/apps/locker/lib/l10n/app_localizations.dartindex 26766c5076..059d0bc20a 100644--- a/mobile/apps/locker/lib/l10n/app_localizations.dart+++ b/mobile/apps/locker/lib/l10n/app_localizations.dart@@ -2086,6 +2086,168 @@ abstract class AppLocalizations {/// **'Locker'**String get locker;+ /// No description provided for @loginToEnteAccount.+ ///+ /// In en, this message translates to:+ /// **'Log in to your Ente account'**+ String get loginToEnteAccount;++ /// No description provided for @unlockLockerPaidPlanTitle.+ ///+ /// In en, this message translates to:+ /// **'Unlock locker with a paid plan'**+ String get unlockLockerPaidPlanTitle;++ /// No description provided for @unlockLockerPaidPlanBody.+ ///+ /// In en, this message translates to:+ /// **'Locker is available only to paid customers of Ente Photos. Upgrade to a paid plan from Photos to use Locker'**+ String get unlockLockerPaidPlanBody;++ /// No description provided for @checkoutEntePhotos.+ ///+ /// In en, this message translates to:+ /// **'Checkout Ente Photos'**+ String get checkoutEntePhotos;++ /// No description provided for @noAccountCta.+ ///+ /// In en, this message translates to:+ /// **'I don\'t have an account'**+ String get noAccountCta;++ /// No description provided for @featureSaveImportant.+ ///+ /// In en, this message translates to:+ /// **'Save your important documents and credentials'**+ String get featureSaveImportant;++ /// No description provided for @featurePassAutomatically.+ ///+ /// In en, this message translates to:+ /// **'Pass them on automatically in emergencies'**+ String get featurePassAutomatically;++ /// No description provided for @featureShareAnytime.+ ///+ /// In en, this message translates to:+ /// **'Share them anytime'**+ String get featureShareAnytime;++ /// No description provided for @emailIdLabel.+ ///+ /// In en, this message translates to:+ /// **'Email id'**+ String get emailIdLabel;++ /// No description provided for @emailIdHint.+ ///+ /// In en, this message translates to:+ /// **'Enter your email id'**+ String get emailIdHint;++ /// No description provided for @loginPasswordLabel.+ ///+ /// In en, this message translates to:+ /// **'Password'**+ String get loginPasswordLabel;++ /// No description provided for @loginPasswordHint.+ ///+ /// In en, this message translates to:+ /// **'Enter your password'**+ String get loginPasswordHint;++ /// No description provided for @forgotPassword.+ ///+ /// In en, this message translates to:+ /// **'Forgot Password?'**+ String get forgotPassword;++ /// No description provided for @logInAction.+ ///+ /// In en, this message translates to:+ /// **'Log in'**+ String get logInAction;++ /// No description provided for @dontHaveAccount.+ ///+ /// In en, this message translates to:+ /// **'Don\'t have an account?'**+ String get dontHaveAccount;++ /// No description provided for @signUp.+ ///+ /// In en, this message translates to:+ /// **'Sign up'**+ String get signUp;++ /// No description provided for @incorrectPassword.+ ///+ /// In en, this message translates to:+ /// **'Incorrect Password'**+ String get incorrectPassword;++ /// No description provided for @pleaseTryAgain.+ ///+ /// In en, this message translates to:+ /// **'Please try again'**+ String get pleaseTryAgain;++ /// No description provided for @noInternetConnection.+ ///+ /// In en, this message translates to:+ /// **'No Internet Connection'**+ String get noInternetConnection;++ /// No description provided for @checkInternetConnection.+ ///+ /// In en, this message translates to:+ /// **'Please check your internet connection and try again'**+ String get checkInternetConnection;++ /// No description provided for @verificationFailedTryAgain.+ ///+ /// In en, this message translates to:+ /// **'Verification failed, please try again'**+ String get verificationFailedTryAgain;++ /// No description provided for @recreatePassword.+ ///+ /// In en, this message translates to:+ /// **'Recreate password'**+ String get recreatePassword;++ /// No description provided for @deviceCannotVerifyPassword.+ ///+ /// In en, this message translates to:+ /// **'Your device does not have enough memory to verify your password'**+ String get deviceCannotVerifyPassword;++ /// No description provided for @useRecoveryKey.+ ///+ /// In en, this message translates to:+ /// **'Use recovery key'**+ String get useRecoveryKey;++ /// No description provided for @invalidEmail.+ ///+ /// In en, this message translates to:+ /// **'Invalid Email'**+ String get invalidEmail;++ /// No description provided for @enterValidEmailFirst.+ ///+ /// In en, this message translates to:+ /// **'Please enter a valid email address first'**+ String get enterValidEmailFirst;++ /// No description provided for @lockerLoginIssueSubject.+ ///+ /// In en, this message translates to:+ /// **'Locker Login Issue'**+ String get lockerLoginIssueSubject;+/// No description provided for @unnamed.////// In en, this message translates to:diff --git a/mobile/apps/locker/lib/l10n/app_localizations_en.dart b/mobile/apps/locker/lib/l10n/app_localizations_en.dartindex d8d0dd43dc..70c9ceca2c 100644--- a/mobile/apps/locker/lib/l10n/app_localizations_en.dart+++ b/mobile/apps/locker/lib/l10n/app_localizations_en.dart@@ -1199,6 +1199,93 @@ class AppLocalizationsEn extends AppLocalizations {@overrideString get locker => 'Locker';+ @override+ String get loginToEnteAccount => 'Log in to your Ente account';++ @override+ String get unlockLockerPaidPlanTitle => 'Unlock locker with a paid plan';++ @override+ String get unlockLockerPaidPlanBody =>+ 'Locker is available only to paid customers of Ente Photos. Upgrade to a paid plan from Photos to use Locker';++ @override+ String get checkoutEntePhotos => 'Checkout Ente Photos';++ @override+ String get noAccountCta => 'I don\'t have an account';++ @override+ String get featureSaveImportant =>+ 'Save your important documents and credentials';++ @override+ String get featurePassAutomatically =>+ 'Pass them on automatically in emergencies';++ @override+ String get featureShareAnytime => 'Share them anytime';++ @override+ String get emailIdLabel => 'Email id';++ @override+ String get emailIdHint => 'Enter your email id';++ @override+ String get loginPasswordLabel => 'Password';++ @override+ String get loginPasswordHint => 'Enter your password';++ @override+ String get forgotPassword => 'Forgot Password?';++ @override+ String get logInAction => 'Log in';++ @override+ String get dontHaveAccount => 'Don\'t have an account?';++ @override+ String get signUp => 'Sign up';++ @override+ String get incorrectPassword => 'Incorrect Password';++ @override+ String get pleaseTryAgain => 'Please try again';++ @override+ String get noInternetConnection => 'No Internet Connection';++ @override+ String get checkInternetConnection =>+ 'Please check your internet connection and try again';++ @override+ String get verificationFailedTryAgain =>+ 'Verification failed, please try again';++ @override+ String get recreatePassword => 'Recreate password';++ @override+ String get deviceCannotVerifyPassword =>+ 'Your device does not have enough memory to verify your password';++ @override+ String get useRecoveryKey => 'Use recovery key';++ @override+ String get invalidEmail => 'Invalid Email';++ @override+ String get enterValidEmailFirst => 'Please enter a valid email address first';++ @override+ String get lockerLoginIssueSubject => 'Locker Login Issue';+@overrideString get unnamed => 'Unnamed';diff --git a/mobile/apps/locker/lib/ui/pages/login_page.dart b/mobile/apps/locker/lib/ui/pages/login_page.dartindex 9a6669e4aa..e89da30e13 100644--- a/mobile/apps/locker/lib/ui/pages/login_page.dart+++ b/mobile/apps/locker/lib/ui/pages/login_page.dart@@ -127,8 +127,8 @@ class _LoginPageState extends State<LoginPage> {_logger.severe('Server reject, failed verify SRP login', e, s);await showErrorDialog(context,- 'Incorrect Password',- 'Please try again',+ context.l10n.incorrectPassword,+ context.l10n.pleaseTryAgain,);} else {_logger.severe('API failure during SRP login ${e.type}', e, s);@@ -137,14 +137,14 @@ class _LoginPageState extends State<LoginPage> {e.type == DioExceptionType.sendTimeout) {await showErrorDialog(context,- 'No Internet Connection',- 'Please check your internet connection and try again',+ context.l10n.noInternetConnection,+ context.l10n.checkInternetConnection,);} else {await showErrorDialog(context,- 'Something went wrong',- 'Verification failed, please try again',+ context.l10n.somethingWentWrong,+ context.l10n.verificationFailedTryAgain,);}}@@ -162,10 +162,9 @@ class _LoginPageState extends State<LoginPage> {} else if (e is KeyDerivationError) {final dialogChoice = await showChoiceDialog(context,- title: 'Recreate password',- body:- 'Your device does not have enough memory to verify your password',- firstButtonLabel: 'Use recovery key',+ title: context.l10n.recreatePassword,+ body: context.l10n.deviceCannotVerifyPassword,+ firstButtonLabel: context.l10n.useRecoveryKey,);if (dialogChoice!.action == ButtonAction.first) {await UserService.instance.sendOtt(@@ -179,8 +178,8 @@ class _LoginPageState extends State<LoginPage> {_logger.severe('unexpected error while verifying password', e, s);await _showContactSupportDialog(context,- 'Oops',- 'Verification failed, please try again',+ context.l10n.oops,+ context.l10n.verificationFailedTryAgain,);}}@@ -195,14 +194,15 @@ class _LoginPageState extends State<LoginPage> {context,title: title,body: message,- firstButtonLabel: 'Contact support',- secondButtonLabel: 'OK',+ firstButtonLabel: context.l10n.contactSupport,+ secondButtonLabel: context.l10n.ok,);if (dialogChoice!.action == ButtonAction.first) {final Uri emailUri = Uri(scheme: 'mailto',path: '[email protected]',- query: 'subject=Locker Login Issue',+ query:+ 'subject=${Uri.encodeComponent(context.l10n.lockerLoginIssueSubject)}',);if (await canLaunchUrl(emailUri)) {await launchUrl(emailUri);@@ -214,8 +214,8 @@ class _LoginPageState extends State<LoginPage> {if (_email == null || !_emailIsValid) {await showErrorDialog(context,- 'Invalid Email',- 'Please enter a valid email address first',+ context.l10n.invalidEmail,+ context.l10n.enterValidEmailFirst,);return;}@@ -230,10 +230,9 @@ class _LoginPageState extends State<LoginPage> {void _handleSignUp() {showCreateNewAccountDialog(context,- title: "Unlock locker with a paid plan",- body:- "Locker is available only to Ente photos paid users. Upgrade to a paid plan from Photos to use Locker",- buttonLabel: "Checkout Ente Photos",+ title: context.l10n.unlockLockerPaidPlanTitle,+ body: context.l10n.unlockLockerPaidPlanBody,+ buttonLabel: context.l10n.checkoutEntePhotos,assetPath: "assets/file_lock.png",icon: const SizedBox.shrink(),);@@ -248,12 +247,13 @@ class _LoginPageState extends State<LoginPage> {Widget build(BuildContext context) {final colorScheme = getEnteColorScheme(context);final textTheme = getEnteTextTheme(context);+ final l10n = context.l10n;return Scaffold(backgroundColor: colorScheme.backgroundBase,appBar: AppBar(title: Text(- "Locker",+ l10n.locker,style: textTheme.h3Bold.copyWith(color: colorScheme.primary700,),@@ -282,7 +282,7 @@ class _LoginPageState extends State<LoginPage> {children: [const SizedBox(height: 24),Text(- "Email id",+ l10n.emailIdLabel,style: textTheme.bodyBold.copyWith(color: colorScheme.textBase,),@@ -292,7 +292,7 @@ class _LoginPageState extends State<LoginPage> {key: const ValueKey("emailInputField"),autofillHints: const [AutofillHints.email],decoration: InputDecoration(- hintText: "Enter your email id",+ hintText: l10n.emailIdHint,hintStyle: textTheme.body.copyWith(color: colorScheme.textMuted,),@@ -339,7 +339,7 @@ class _LoginPageState extends State<LoginPage> {),const SizedBox(height: 24),Text(- "Password",+ l10n.loginPasswordLabel,style: textTheme.bodyBold.copyWith(color: colorScheme.textBase,),@@ -349,7 +349,7 @@ class _LoginPageState extends State<LoginPage> {key: const ValueKey("passwordInputField"),autofillHints: const [AutofillHints.password],decoration: InputDecoration(- hintText: "Enter your password",+ hintText: l10n.loginPasswordHint,hintStyle: textTheme.body.copyWith(color: colorScheme.textMuted,),@@ -396,7 +396,7 @@ class _LoginPageState extends State<LoginPage> {child: TextButton(onPressed: _handleForgotPassword,child: Text(- "Forgot Password?",+ l10n.forgotPassword,style: textTheme.bodyBold.copyWith(color: colorScheme.primary700,decoration: TextDecoration.underline,@@ -420,7 +420,7 @@ class _LoginPageState extends State<LoginPage> {await _handleLogin();}: null,- text: "Log in",+ text: l10n.logInAction,),),const SizedBox(height: 16),@@ -433,9 +433,9 @@ class _LoginPageState extends State<LoginPage> {color: colorScheme.textBase,),children: [- const TextSpan(text: "Don't have an account? "),+ TextSpan(text: '${l10n.dontHaveAccount} '),TextSpan(- text: "Sign up",+ text: l10n.signUp,style: textTheme.bodyBold.copyWith(color: colorScheme.primary700,decoration: TextDecoration.underline,diff --git a/mobile/apps/locker/lib/ui/pages/onboarding_page.dart b/mobile/apps/locker/lib/ui/pages/onboarding_page.dartindex 95f9df00f3..4a389a2ed9 100644--- a/mobile/apps/locker/lib/ui/pages/onboarding_page.dart+++ b/mobile/apps/locker/lib/ui/pages/onboarding_page.dart@@ -65,16 +65,16 @@ class _OnboardingPageState extends State<OnboardingPage> {child: Column(children: [const Padding(padding: EdgeInsets.all(12)),- const Text(- "Locker",- style: TextStyle(+ Text(+ l10n.locker,+ style: const TextStyle(color: Colors.white,fontSize: 32,fontWeight: FontWeight.w600,),),const Padding(padding: EdgeInsets.all(28)),- _getFeatureSlider(),+ _getFeatureSlider(context),const Padding(padding: EdgeInsets.all(12)),DotsIndicator(dotsCount: 3,@@ -117,7 +117,7 @@ class _OnboardingPageState extends State<OnboardingPage> {),onPressed: _navigateToSignInPage,child: Text(- "Log in to your Ente account",+ l10n.loginToEnteAccount,style: getEnteTextTheme(context).bodyBold.copyWith(color: colorScheme.primary700,),@@ -130,16 +130,15 @@ class _OnboardingPageState extends State<OnboardingPage> {onPressed: () {showCreateNewAccountDialog(context,- title: "Unlock locker with a paid plan",- body:- "Locker is available only to Ente photos paid users. Upgrade to a paid plan from Photos to use Locker",- buttonLabel: "Checkout Ente Photos",+ title: l10n.unlockLockerPaidPlanTitle,+ body: l10n.unlockLockerPaidPlanBody,+ buttonLabel: l10n.checkoutEntePhotos,assetPath: "assets/file_lock.png",icon: const SizedBox.shrink(),);},child: Text(- "I don't have an account",+ l10n.noAccountCta,style: getEnteTextTheme(context).bodyBold.copyWith(color: Colors.white,decoration: TextDecoration.underline,@@ -156,25 +155,23 @@ class _OnboardingPageState extends State<OnboardingPage> {);}- Widget _getFeatureSlider() {+ Widget _getFeatureSlider(BuildContext context) {+ final l10n = context.l10n;return ConstrainedBox(constraints: const BoxConstraints(maxHeight: 420),child: PageView(- children: const [+ children: [FeatureItemWidget("assets/onboarding_lock.png",- "Save your important",- "documents and credentials",+ l10n.featureSaveImportant,),FeatureItemWidget("assets/onboarding_file.png",- "Pass them on automatically in",- "emergencies",+ l10n.featurePassAutomatically,),FeatureItemWidget("assets/onboarding_share.png",- "Share them anytime",- "",+ l10n.featureShareAnytime,),],onPageChanged: (index) {@@ -224,12 +221,10 @@ class _OnboardingPageState extends State<OnboardingPage> {class FeatureItemWidget extends StatelessWidget {final String assetPath;final String featureTitleFirstLine;- final String featureTitleSecondLine;const FeatureItemWidget(this.assetPath,- this.featureTitleFirstLine,- this.featureTitleSecondLine, {+ this.featureTitleFirstLine, {super.key,});@@ -242,30 +237,23 @@ class FeatureItemWidget extends StatelessWidget {assetPath,height: 200,),- Column(- crossAxisAlignment: CrossAxisAlignment.center,- mainAxisAlignment: MainAxisAlignment.start,- children: [- Text(- featureTitleFirstLine,- style: const TextStyle(- color: Colors.white,- fontSize: 24,- fontWeight: FontWeight.w600,- ),- textAlign: TextAlign.center,- ),- const Padding(padding: EdgeInsets.all(2)),- Text(- featureTitleSecondLine,- style: const TextStyle(- color: Colors.white,- fontSize: 24,- fontWeight: FontWeight.w600,+ Padding(+ padding: const EdgeInsets.all(16),+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.center,+ mainAxisAlignment: MainAxisAlignment.start,+ children: [+ Text(+ featureTitleFirstLine,+ style: const TextStyle(+ color: Colors.white,+ fontSize: 24,+ fontWeight: FontWeight.w600,+ ),+ textAlign: TextAlign.center,),- textAlign: TextAlign.center,- ),- ],+ ],+ ),),],);