From ea6a9741eed8193e5f3f3caee278020d155a4c58 Mon Sep 17 00:00:00 2001 From: aitorarana Date: Thu, 18 Dec 2025 11:13:58 +0100 Subject: [PATCH] Updated locale keys --- .../new_password/new_password_screen.dart | 22 +++--- .../request_recovery_screen.dart | 14 ++-- .../presentation/sent/sent_screen.dart | 20 +++--- packages/sf_localizations/assets/l10n/en.json | 2 +- packages/sf_localizations/assets/l10n/es.json | 2 +- packages/sf_localizations/assets/l10n/it.json | 2 +- packages/sf_localizations/assets/l10n/pt.json | 2 +- .../lib/sf_localizations.dart | 1 - .../lib/src/generated/i18n.dart | 71 +++++++++++++------ 9 files changed, 81 insertions(+), 55 deletions(-) diff --git a/modules/auth/lib/src/features/recover_password/presentation/new_password/new_password_screen.dart b/modules/auth/lib/src/features/recover_password/presentation/new_password/new_password_screen.dart index 1cfa07cc..070ac3d3 100644 --- a/modules/auth/lib/src/features/recover_password/presentation/new_password/new_password_screen.dart +++ b/modules/auth/lib/src/features/recover_password/presentation/new_password/new_password_screen.dart @@ -29,7 +29,7 @@ class NewPasswordScreen extends ConsumerWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - context.translate(LocaleKeys.recoverPasswordTitle), + context.translate(I18n.recoverPasswordTitle), textAlign: TextAlign.center, style: TextStyle( fontWeight: FontWeight.w500, @@ -40,7 +40,7 @@ class NewPasswordScreen extends ConsumerWidget { SizedBox(height: SizeUtils.getByScreen(small: 42, big: 32)), CustomTextField( showPassword: viewState.passwordVisible, - label: context.translate(LocaleKeys.newPassword), + label: context.translate(I18n.newPassword), labelSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12), hint: '********', controller: viewModel.passwordController, @@ -49,7 +49,7 @@ class NewPasswordScreen extends ConsumerWidget { SizedBox(height: 16), CustomTextField( showPassword: viewState.passwordVisible, - label: context.translate(LocaleKeys.repeatPassword), + label: context.translate(I18n.repeatPassword), labelSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12), hint: '********', controller: viewModel.repeatedPasswordController, @@ -67,7 +67,7 @@ class NewPasswordScreen extends ConsumerWidget { size: 16, ), Text( - context.translate(LocaleKeys.errorMessageUnequalPasswords), + context.translate(I18n.errorMessageUnequalPasswords), textAlign: TextAlign.left, style: TextStyle( color: Color.fromRGBO(239, 17, 17, 1), @@ -89,7 +89,7 @@ class NewPasswordScreen extends ConsumerWidget { : ThemeCode.buttonSecondary), ), Text( - context.translate(LocaleKeys.passwordLength), + context.translate(I18n.passwordLength), style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12)) ), ], @@ -105,7 +105,7 @@ class NewPasswordScreen extends ConsumerWidget { : ThemeCode.buttonSecondary), ), Text( - context.translate(LocaleKeys.passwordCapital), + context.translate(I18n.passwordCapital), style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12)) ), ], @@ -121,7 +121,7 @@ class NewPasswordScreen extends ConsumerWidget { : ThemeCode.buttonSecondary), ), Text( - context.translate(LocaleKeys.passwordNumber), + context.translate(I18n.passwordNumber), style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12)) ), ], @@ -137,7 +137,7 @@ class NewPasswordScreen extends ConsumerWidget { : ThemeCode.buttonSecondary), ), Text( - context.translate(LocaleKeys.passwordSpecial), + context.translate(I18n.passwordSpecial), style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12)) ), ], @@ -146,7 +146,7 @@ class NewPasswordScreen extends ConsumerWidget { Align( alignment: Alignment.bottomLeft, child: Text( - context.translate(LocaleKeys.mobilePhone), + context.translate(I18n.mobilePhone), style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12), letterSpacing: 0), ) ), @@ -164,7 +164,7 @@ class NewPasswordScreen extends ConsumerWidget { }, ), Expanded(child: CustomTextField( - hint: context.translate(LocaleKeys.phoneNumber), + hint: context.translate(I18n.phoneNumber), numeric: true, controller: viewModel.newPhoneNumberController, )) @@ -190,7 +190,7 @@ class NewPasswordScreen extends ConsumerWidget { navigationContract.goTo(AppRoutes.dashboardHome); } }, - text: context.translate(LocaleKeys.accept), + text: context.translate(I18n.accept), color: theme.getColorFor(ThemeCode.buttonPrimary) ), ], diff --git a/modules/auth/lib/src/features/recover_password/presentation/request_recovery/request_recovery_screen.dart b/modules/auth/lib/src/features/recover_password/presentation/request_recovery/request_recovery_screen.dart index 662ada93..11d56d6b 100644 --- a/modules/auth/lib/src/features/recover_password/presentation/request_recovery/request_recovery_screen.dart +++ b/modules/auth/lib/src/features/recover_password/presentation/request_recovery/request_recovery_screen.dart @@ -29,26 +29,26 @@ class RequestRecoveryScreen extends ConsumerWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - context.translate(LocaleKeys.recoverPasswordTitle), + context.translate(I18n.recoverPasswordTitle), style: TextStyle(fontWeight: FontWeight.bold, fontSize: SizeUtils.getByScreen(small: 29, big: 29, xl: 26)), ), SizedBox(height: SizeUtils.getByScreen(small: 24, big: 32)), Text( - context.translate(LocaleKeys.recoverPasswordSubtitle), + context.translate(I18n.recoverPasswordSubtitle), textAlign: TextAlign.center, style: TextStyle(letterSpacing: 0, fontSize: SizeUtils.getByScreen(small: 18, big: 18, xl: 16)), ), SizedBox(height: SizeUtils.getByScreen(small: 56, big: 48)), CustomTextField( - label: context.translate(LocaleKeys.email), - hint: context.translate(LocaleKeys.email), + label: context.translate(I18n.email), + hint: context.translate(I18n.email), controller: viewModel.emailController, ), SizedBox(height: SizeUtils.getByScreen(small: 40, big: 40, xl: 28)), Align( alignment: Alignment.bottomLeft, child: Text( - context.translate(LocaleKeys.mobilePhone), + context.translate(I18n.mobilePhone), style: TextStyle(fontSize: 14, letterSpacing: 0), ), ), @@ -92,7 +92,7 @@ class RequestRecoveryScreen extends ConsumerWidget { Expanded( child: SecondaryButton( onPressed: () => {Navigator.pop(context)}, - text: context.translate(LocaleKeys.back), + text: context.translate(I18n.back), size: SizeUtils.getByScreen(small: 16, big: 16, xl: 14), ), ), @@ -111,7 +111,7 @@ class RequestRecoveryScreen extends ConsumerWidget { ); } }, - text: context.translate(LocaleKeys.send), + text: context.translate(I18n.send), size: SizeUtils.getByScreen(small: 16, big: 16, xl: 14), color: theme.getColorFor(ThemeCode.buttonSecondary), ), diff --git a/modules/auth/lib/src/features/recover_password/presentation/sent/sent_screen.dart b/modules/auth/lib/src/features/recover_password/presentation/sent/sent_screen.dart index 182021ff..ddec9f64 100644 --- a/modules/auth/lib/src/features/recover_password/presentation/sent/sent_screen.dart +++ b/modules/auth/lib/src/features/recover_password/presentation/sent/sent_screen.dart @@ -29,7 +29,7 @@ class SentScreen extends ConsumerWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - context.translate(LocaleKeys.recoverPasswordTitle), + context.translate(I18n.recoverPasswordTitle), textAlign: TextAlign.center, style: TextStyle( fontWeight: FontWeight.w500, @@ -48,8 +48,8 @@ class SentScreen extends ConsumerWidget { SizedBox(width: SizeUtils.getByScreen(small: 10, big: 10, xl: 6)), Text( viewState.recoveryFormat == "email" - ? context.translate(LocaleKeys.emailSent) - : context.translate(LocaleKeys.smsSent), + ? context.translate(I18n.emailSent) + : context.translate(I18n.smsSent), style: TextStyle(fontSize: SizeUtils.getByScreen(small: 18, big: 18, xl: 15), fontWeight: FontWeight.bold), ), ], @@ -57,16 +57,16 @@ class SentScreen extends ConsumerWidget { SizedBox(height: SizeUtils.getByScreen(small: 48, big: 48, xl: 40)), Text( viewState.recoveryFormat == "email" - ? context.translate(LocaleKeys.checkEmail1) - : context.translate(LocaleKeys.checkSms1), + ? context.translate(I18n.checkEmail1) + : context.translate(I18n.checkSms1), textAlign: TextAlign.center, style: TextStyle(fontSize: SizeUtils.getByScreen(small: 17, big: 17, xl: 15), letterSpacing: 0), ), SizedBox(height: 16), Text( viewState.recoveryFormat == "email" - ? context.translate(LocaleKeys.checkEmail2) - : context.translate(LocaleKeys.checkSms2), + ? context.translate(I18n.checkEmail2) + : context.translate(I18n.checkSms2), textAlign: TextAlign.center, style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 14, xl: 12), letterSpacing: 0), ), @@ -83,8 +83,8 @@ class SentScreen extends ConsumerWidget { } }, text: viewState.recoveryFormat == "email" - ? context.translate(LocaleKeys.resendEmail) - : context.translate(LocaleKeys.resendSms), + ? context.translate(I18n.resendEmail) + : context.translate(I18n.resendSms), size: SizeUtils.getByScreen(small: 16, big: 16, xl: 14), ), ), @@ -95,7 +95,7 @@ class SentScreen extends ConsumerWidget { context, MaterialPageRoute(builder: (_) => NewPasswordScreen(navigationContract: navigationContract)), ), - text: context.translate(LocaleKeys.continueKey), + text: context.translate(I18n.continueKey), color: theme.getColorFor(ThemeCode.buttonSecondary), size: SizeUtils.getByScreen(small: 16, big: 16, xl: 14), ), diff --git a/packages/sf_localizations/assets/l10n/en.json b/packages/sf_localizations/assets/l10n/en.json index fd11abd1..4adf55d7 100755 --- a/packages/sf_localizations/assets/l10n/en.json +++ b/packages/sf_localizations/assets/l10n/en.json @@ -32,7 +32,7 @@ "checkEmail1": "Check your email and click the link to create a new password.", "checkSms1": "Check your phone and follow the instructions to create a new password.", "checkEmail2": "If you don't receive the email in some minutes, check your spam folder or press \"Resend email\".", - "checkSms2": "If you don't receive the SMS in some minutes, make sure you have signal or press \"Resend SMS\"", + "checkSms2": "If you don't receive the SMS in some minutes, make sure you have signal or press \"Resend SMS\".", "resendEmail": "Resend email", "resendSms": "Resend SMS", "continueKey": "Continue", diff --git a/packages/sf_localizations/assets/l10n/es.json b/packages/sf_localizations/assets/l10n/es.json index ccfe576a..83ec610c 100644 --- a/packages/sf_localizations/assets/l10n/es.json +++ b/packages/sf_localizations/assets/l10n/es.json @@ -32,7 +32,7 @@ "checkEmail1": "Revisa tu email y haz clic en el enlace para crear una nueva contraseña.", "checkSms1": "Revisa tu móvil y sigue las instrucciones para crear una nueva contraseña.", "checkEmail2": "Si no recibes el correo en unos minutos, revisa tu carpeta de spam o pulsa \"Reenviar correo\".", - "checkSms2": "Si no recibes el SMS en unos minutos, asegúrate de tener cobertura o pulsa \"Reenviar SMS\"", + "checkSms2": "Si no recibes el SMS en unos minutos, asegúrate de tener cobertura o pulsa \"Reenviar SMS\".", "resendEmail": "Reenviar correo", "resendSms": "Reenviar SMS", "continueKey": "Continuar", diff --git a/packages/sf_localizations/assets/l10n/it.json b/packages/sf_localizations/assets/l10n/it.json index 0384d084..648a9c0e 100644 --- a/packages/sf_localizations/assets/l10n/it.json +++ b/packages/sf_localizations/assets/l10n/it.json @@ -32,7 +32,7 @@ "checkEmail1": "Controlla la tua email e fai clic sul collegamento per creare una nuova password.", "checkSms1": "Controlla il tuo telefono e segui le istruzioni per creare una nuova password", "checkEmail2": "Se non ricevi l'e-mail entro pochi minuti, controlla la cartella spam o premi \"Invia nuovamente e-mail\".", - "checkSms2": "Se non ricevi l'SMS entro pochi minuti, assicurati di avere copertura oppure premi \"Rinvia SMS\"", + "checkSms2": "Se non ricevi l'SMS entro pochi minuti, assicurati di avere copertura oppure premi \"Rinvia SMS\".", "resendEmail": "Inoltra la posta", "resendSms": "Inoltra SMS", "continueKey": "Continuare", diff --git a/packages/sf_localizations/assets/l10n/pt.json b/packages/sf_localizations/assets/l10n/pt.json index ce523889..6f27616a 100644 --- a/packages/sf_localizations/assets/l10n/pt.json +++ b/packages/sf_localizations/assets/l10n/pt.json @@ -32,7 +32,7 @@ "checkEmail1": "Revise seu e-mail e clique no link para criar uma nova senha.", "checkSms1": "Revise seu celular e siga as instruções para criar uma nova senha", "checkEmail2": "Se você não receber a correspondência em alguns minutos, revise sua pasta de spam ou pressione \"Reenviar correspondência\".", - "checkSms2": "Se você não receber o SMS em alguns minutos, certifique-se de ter cobertura ou pressione \"Reenviar SMS\"", + "checkSms2": "Se você não receber o SMS em alguns minutos, certifique-se de ter cobertura ou pressione \"Reenviar SMS\".", "resendEmail": "Reenviar correio", "resendSms": "Reenviar SMS", "continueKey": "Continuar", diff --git a/packages/sf_localizations/lib/sf_localizations.dart b/packages/sf_localizations/lib/sf_localizations.dart index 6fc48667..3a2bc410 100755 --- a/packages/sf_localizations/lib/sf_localizations.dart +++ b/packages/sf_localizations/lib/sf_localizations.dart @@ -1,6 +1,5 @@ export 'src/sf_delegate.dart'; export 'src/generated/i18n.dart'; -export 'src/generated/i18n.g.dart'; export 'src/utils/constants.dart'; export 'src/utils/context_extension.dart'; export 'src/utils/string_extension.dart'; diff --git a/packages/sf_localizations/lib/src/generated/i18n.dart b/packages/sf_localizations/lib/src/generated/i18n.dart index 84ec6a23..6ccf4c1f 100755 --- a/packages/sf_localizations/lib/src/generated/i18n.dart +++ b/packages/sf_localizations/lib/src/generated/i18n.dart @@ -3,26 +3,53 @@ class I18n { const I18n._(); - static const String example = 'example'; - static const String start = 'start'; - static const String next = 'next'; - static const String skip = 'skip'; - static const String onboardingTitle1 = 'onboardingTitle1'; - static const String onboardingSubtitle1 = 'onboardingSubtitle1'; - static const String onboardingTitle2 = 'onboardingTitle2'; - static const String onboardingSubtitle2 = 'onboardingSubtitle2'; - static const String onboardingTitle3 = 'onboardingTitle3'; - static const String onboardingSubtitle3 = 'onboardingSubtitle3'; - static const String linkPhoneTitle = 'linkPhoneTitle'; - static const String linkPhoneSubtitle = 'linkPhoneSubtitle'; - static const String mobilePhone = 'mobilePhone'; - static const String phoneNumber = 'phoneNumber'; - static const String selectYourCountry = 'selectYourCountry'; - static const String errorMessagePhoneIsEmpty = 'errorMessagePhoneIsEmpty'; - static const String connect = "connect"; - static const String verificationCodeSentTo = "verificationCodeSentTo"; - static const String enterCodeHere = "enterCodeHere"; - static const String enter = "enter"; - static const String didNotReceiveIt = "didNotReceiveIt"; - static const String tryAgain = "tryAgain"; + static const example = 'example'; + static const onboardingTitle1 = 'onboardingTitle1'; + static const onboardingSubtitle1 = 'onboardingSubtitle1'; + static const onboardingTitle2 = 'onboardingTitle2'; + static const onboardingSubtitle2 = 'onboardingSubtitle2'; + static const onboardingTitle3 = 'onboardingTitle3'; + static const onboardingSubtitle3 = 'onboardingSubtitle3'; + static const start = 'start'; + static const next = 'next'; + static const skip = 'skip'; + static const linkPhoneTitle = 'linkPhoneTitle'; + static const linkPhoneSubtitle = 'linkPhoneSubtitle'; + static const mobilePhone = 'mobilePhone'; + static const phoneNumber = 'phoneNumber'; + static const selectYourCountry = 'selectYourCountry'; + static const errorMessagePhoneIsEmpty = 'errorMessagePhoneIsEmpty'; + static const connect = 'connect'; + static const verificationCodeSentTo = 'verificationCodeSentTo'; + static const enterCodeHere = 'enterCodeHere'; + static const enter = 'enter'; + static const didNotReceiveIt = 'didNotReceiveIt'; + static const tryAgain = 'tryAgain'; + static const recoverPasswordTitle = 'recoverPasswordTitle'; + static const recoverPasswordSubtitle = 'recoverPasswordSubtitle'; + static const send = 'send'; + static const back = 'back'; + static const email = 'email'; + static const errorMessageContactIsEmpty = 'errorMessageContactIsEmpty'; + static const emailSent = 'emailSent'; + static const smsSent = 'smsSent'; + static const checkEmail1 = 'checkEmail1'; + static const checkSms1 = 'checkSms1'; + static const checkEmail2 = 'checkEmail2'; + static const checkSms2 = 'checkSms2'; + static const resendEmail = 'resendEmail'; + static const resendSms = 'resendSms'; + static const continueKey = 'continueKey'; + static const newPassword = 'newPassword'; + static const repeatPassword = 'repeatPassword'; + static const passwordLength = 'passwordLength'; + static const passwordCapital = 'passwordCapital'; + static const passwordNumber = 'passwordNumber'; + static const passwordSpecial = 'passwordSpecial'; + static const accept = 'accept'; + static const errorMessageUnequalPasswords = 'errorMessageUnequalPasswords'; + static const errorMessagePasswordTooShort = 'errorMessagePasswordTooShort'; + static const errorMessagePasswordNoCapitals = 'errorMessagePasswordNoCapitals'; + static const errorMessagePasswordNoNumbers = 'errorMessagePasswordNoNumbers'; + static const errorMessagePasswordNoSpecialChars = 'errorMessagePasswordNoSpecialChars'; }