diff --git a/packages/deriv_auth/lib/core/extensions/context_extension.dart b/packages/deriv_auth/lib/core/extensions/context_extension.dart index d3caeff30..653b70552 100644 --- a/packages/deriv_auth/lib/core/extensions/context_extension.dart +++ b/packages/deriv_auth/lib/core/extensions/context_extension.dart @@ -4,5 +4,6 @@ import 'package:flutter/material.dart'; /// Extension methods for [BuildContext]. extension ContextExtension on BuildContext { /// Gets [DerivAuthUILocalization]. - DerivAuthLocalization get localization => DerivAuthLocalization.of(this); + DerivAuthLocalization get derivAuthLocalization => + DerivAuthLocalization.of(this); } diff --git a/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart b/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart index cf08bdf6a..06664331c 100644 --- a/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart +++ b/packages/deriv_auth/lib/core/helpers/country_selection_helper.dart @@ -32,7 +32,7 @@ String getCountryConsentMessage( } final Map consentMessages = { - 'br': context.localization.labelCountryConsentBrazil, + 'br': context.derivAuthLocalization.labelCountryConsentBrazil, // Add more countries and consent messages here. }; diff --git a/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart b/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart index 70f660892..b00eedf59 100644 --- a/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart +++ b/packages/deriv_auth/lib/core/layouts/deriv_unavailable_country_layout.dart @@ -28,7 +28,7 @@ class DerivUnavailableCountryLayout extends StatelessWidget { Widget build(BuildContext context) => Scaffold( appBar: AppBar( elevation: ThemeProvider.zeroMargin, - title: Text(context.localization.labelNotAvailable), + title: Text(context.derivAuthLocalization.labelNotAvailable), ), body: Container( padding: @@ -50,14 +50,15 @@ class DerivUnavailableCountryLayout extends StatelessWidget { children: [ const SizedBox(height: ThemeProvider.margin16), Text( - context.localization.warnNotAvailableCountriesTitle(appName), + context.derivAuthLocalization + .warnNotAvailableCountriesTitle(appName), style: TextStyles.title, textAlign: TextAlign.center, ), const SizedBox(height: ThemeProvider.margin08), RichText( text: TextSpan( - text: context.localization.warnNotAvailableCountries, + text: context.derivAuthLocalization.warnNotAvailableCountries, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -65,7 +66,7 @@ class DerivUnavailableCountryLayout extends StatelessWidget { children: [ buildTextSpanHyperlink( context: context, - label: context.localization.labelLiveChat, + label: context.derivAuthLocalization.labelLiveChat, onTap: onLiveChatPressed, style: context.theme.textStyle( textStyle: TextStyles.body1Bold, diff --git a/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart b/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart index 4b82a278c..d07081992 100644 --- a/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart +++ b/packages/deriv_auth/lib/core/states/auth_error_state_handler.dart @@ -20,8 +20,8 @@ base class AuthErrorStateHandler { void invalid2faCode(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informInvalid2FACode, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informInvalid2FACode, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -29,8 +29,8 @@ base class AuthErrorStateHandler { void onAccountUnavailable(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informDeactivatedAccount, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informDeactivatedAccount, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -38,8 +38,8 @@ base class AuthErrorStateHandler { void onExpiredAccount(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informExpiredAccount, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informExpiredAccount, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -47,8 +47,8 @@ base class AuthErrorStateHandler { void onFailedAuthorization(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informFailedAuthorization, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informFailedAuthorization, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -56,8 +56,8 @@ base class AuthErrorStateHandler { void onInavlidResidence(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informInvalidResidence, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informInvalidResidence, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -65,8 +65,8 @@ base class AuthErrorStateHandler { void onInvalidCredentials(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informInvalidCredentials, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informInvalidCredentials, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -74,8 +74,8 @@ base class AuthErrorStateHandler { void onMissingOtp(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informMissingOtp, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informMissingOtp, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -83,8 +83,8 @@ base class AuthErrorStateHandler { void onSelfClosed(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informSelfClosed, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informSelfClosed, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -92,8 +92,8 @@ base class AuthErrorStateHandler { void onUnexpectedError(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informUnexpectedError, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informUnexpectedError, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -101,8 +101,8 @@ base class AuthErrorStateHandler { void onUnsupportedCountry(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informUnsupportedCountry, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informUnsupportedCountry, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -110,8 +110,8 @@ base class AuthErrorStateHandler { void onConnectionError(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informConnectionError, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informConnectionError, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } @@ -119,8 +119,8 @@ base class AuthErrorStateHandler { void onSwitchAccountError(DerivAuthErrorState state) { showErrorDialog( context: context, - errorMessage: context.localization.informSwitchAccountError, - actionLabel: context.localization.actionTryAgain, + errorMessage: context.derivAuthLocalization.informSwitchAccountError, + actionLabel: context.derivAuthLocalization.actionTryAgain, ); } } diff --git a/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart b/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart index 4e06af088..4543a1ce9 100644 --- a/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart +++ b/packages/deriv_auth/lib/features/get_started/presentation/layouts/deriv_get_started_layout.dart @@ -147,7 +147,7 @@ class _DerivGetStartedLayoutState extends State { onPressed: widget.onSignupTapped, child: Center( child: Text( - context.localization.actionGetAFreeAccount, + context.derivAuthLocalization.actionGetAFreeAccount, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent, @@ -163,7 +163,7 @@ class _DerivGetStartedLayoutState extends State { onPressed: widget.onLoginTapped, child: Center( child: Text( - context.localization.actionLogin, + context.derivAuthLocalization.actionLogin, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent, diff --git a/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart b/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart index eda8a4412..045deadb1 100644 --- a/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart +++ b/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_2fa_layout.dart @@ -38,7 +38,7 @@ class _Deriv2FALayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.localization.labelLogIn, + context.derivAuthLocalization.labelLogIn, style: TextStyles.title, ), ), @@ -53,13 +53,13 @@ class _Deriv2FALayoutState extends State { children: [ SvgPicture.asset(Assets.twoFactorAuthIcon), Text( - context.localization.labelTwoFactorAuth, + context.derivAuthLocalization.labelTwoFactorAuth, style: context.theme.textStyle(textStyle: TextStyles.title), textAlign: TextAlign.center, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.localization.informEnterTwoFactorAuthCode, + context.derivAuthLocalization.informEnterTwoFactorAuthCode, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -69,8 +69,8 @@ class _Deriv2FALayoutState extends State { const SizedBox(height: ThemeProvider.margin24), BaseTextField( controller: _otpController, - labelText: - context.localization.labelTwoFactorAuthenticationCode, + labelText: context + .derivAuthLocalization.labelTwoFactorAuthenticationCode, labelColor: context.theme.colors.disabled, focusNode: _otpFocusNode, enabled: !_isLoading(), @@ -100,7 +100,7 @@ class _Deriv2FALayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.localization.actionProceed, + context.derivAuthLocalization.actionProceed, style: TextStyles.body2.copyWith( color: context.theme.colors.prominent, ), diff --git a/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_login_layout.dart b/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_login_layout.dart index da7845066..4376b4e07 100644 --- a/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_login_layout.dart +++ b/packages/deriv_auth/lib/features/login/presentation/layouts/deriv_login_layout.dart @@ -93,7 +93,7 @@ class _DerivLoginLayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.localization.labelLogIn, + context.derivAuthLocalization.labelLogIn, style: TextStyles.title, ), backgroundColor: context.theme.colors.secondary, @@ -126,7 +126,7 @@ class _DerivLoginLayoutState extends State { _buildLoginButton(), const SizedBox(height: ThemeProvider.margin24), DerivSocialAuthDivider( - label: context.localization.informLoginOptions, + label: context.derivAuthLocalization.informLoginOptions, isVisible: widget.isSocialAuthEnabled, ), if (widget.isSocialAuthEnabled) @@ -173,7 +173,7 @@ class _DerivLoginLayoutState extends State { semanticLabel: SemanticsLabels.loginEmailFieldSemantic, controller: _emailController, focusNode: _emailFocusNode, - labelText: context.localization.labelEmail, + labelText: context.derivAuthLocalization.labelEmail, borderColor: context.theme.colors.hover, focusedBorderColor: context.theme.colors.blue, keyboardType: TextInputType.emailAddress, @@ -188,7 +188,7 @@ class _DerivLoginLayoutState extends State { semanticLabel: SemanticsLabels.loginPasswordFieldSemantic, controller: _passwordController, focusNode: _passwordFocusNode, - labelText: context.localization.labelPassword, + labelText: context.derivAuthLocalization.labelPassword, obscureText: !_isPasswordVisible, enabled: isEnabled, suffixIcon: IconButton( @@ -214,7 +214,7 @@ class _DerivLoginLayoutState extends State { child: InkWell( onTap: widget.onResetPassTapped, child: Text( - context.localization.actionForgotPassword, + context.derivAuthLocalization.actionForgotPassword, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.coral, @@ -247,7 +247,7 @@ class _DerivLoginLayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.localization.actionLogin, + context.derivAuthLocalization.actionLogin, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent.withOpacity( @@ -264,7 +264,7 @@ class _DerivLoginLayoutState extends State { mainAxisSize: MainAxisSize.min, children: [ Text( - context.localization.labelDontHaveAnAccountYet, + context.derivAuthLocalization.labelDontHaveAnAccountYet, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -275,7 +275,7 @@ class _DerivLoginLayoutState extends State { child: Padding( padding: const EdgeInsets.all(ThemeProvider.margin04), child: Text( - context.localization.actionCreateANewAccount, + context.derivAuthLocalization.actionCreateANewAccount, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.coral, @@ -312,7 +312,7 @@ class _DerivLoginLayoutState extends State { return null; } - return context.localization.informInvalidEmailFormat; + return context.derivAuthLocalization.informInvalidEmailFormat; } String? _passwordValidator(String? input) { @@ -320,7 +320,7 @@ class _DerivLoginLayoutState extends State { return null; } - return context.localization.warnPasswordLength; + return context.derivAuthLocalization.warnPasswordLength; } Future _onLoginTapped() async { diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart index 9b0e84b1b..73f04ed02 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart @@ -46,7 +46,7 @@ class _DerivChooseNewPassLayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.localization.labelResetPassword, + context.derivAuthLocalization.labelResetPassword, style: TextStyles.title, ), ), @@ -103,14 +103,14 @@ class _DerivChooseNewPassLayoutState extends State { ), const SizedBox(height: ThemeProvider.margin48), Text( - context.localization.labelChooseNewPass, + context.derivAuthLocalization.labelChooseNewPass, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin24), BaseTextField( controller: _passController, focusNode: _passFocusNode, - labelText: context.localization.labelCreatePass, + labelText: context.derivAuthLocalization.labelCreatePass, obscureText: !_isPasswordVisible, suffixIcon: IconButton( icon: Icon( @@ -155,7 +155,7 @@ class _DerivChooseNewPassLayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.localization.actionResetPass, + context.derivAuthLocalization.actionResetPass, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent.withOpacity( @@ -186,7 +186,7 @@ class _DerivChooseNewPassLayoutState extends State { return null; } - return context.localization.informInvalidPasswordFormat; + return context.derivAuthLocalization.informInvalidPasswordFormat; } bool isFormValid() => _passwordValidator(_passController.text) == null; diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart index b6e47a884..2b8f1d5b7 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart @@ -44,7 +44,7 @@ class _DerivResetPassLayoutState extends State { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.localization.labelResetPassword, + context.derivAuthLocalization.labelResetPassword, style: TextStyles.title, ), ), @@ -84,12 +84,12 @@ class _DerivResetPassLayoutState extends State { ), const SizedBox(height: ThemeProvider.margin24), Text( - context.localization.labelCheckEmail, + context.derivAuthLocalization.labelCheckEmail, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.localization + context.derivAuthLocalization .informSendResetPasswordEmail(_emailController.text), textAlign: TextAlign.center, style: context.theme.textStyle( @@ -118,14 +118,14 @@ class _DerivResetPassLayoutState extends State { ), const SizedBox(height: ThemeProvider.margin16), Text( - context.localization.labelResetPassword, + context.derivAuthLocalization.labelResetPassword, style: TextStyles.title, textAlign: TextAlign.center, ), const SizedBox(height: ThemeProvider.margin08), Center( child: Text( - context.localization.informResetPassByEmail, + context.derivAuthLocalization.informResetPassByEmail, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -137,7 +137,7 @@ class _DerivResetPassLayoutState extends State { semanticLabel: SemanticsLabels.resetPasswordEmailFieldSemantic, controller: _emailController, focusNode: _emailFocusNode, - labelText: context.localization.labelEmail, + labelText: context.derivAuthLocalization.labelEmail, keyboardType: TextInputType.emailAddress, borderColor: context.theme.colors.hover, validator: _emailValidator, @@ -173,7 +173,7 @@ class _DerivResetPassLayoutState extends State { width: ThemeProvider.margin16, ) : Text( - context.localization.actionResetPass, + context.derivAuthLocalization.actionResetPass, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent.withOpacity( @@ -209,7 +209,7 @@ class _DerivResetPassLayoutState extends State { return null; } - return context.localization.informInvalidEmailFormat; + return context.derivAuthLocalization.informInvalidEmailFormat; } String _getEmailValue() => _emailController.text.trim(); diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart index d0b2b4050..6bf684972 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart @@ -14,7 +14,7 @@ class DerivSuccessPassChangeLayout extends StatelessWidget { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.localization.labelResetPassword, + context.derivAuthLocalization.labelResetPassword, style: TextStyles.title, ), ), @@ -37,14 +37,14 @@ class DerivSuccessPassChangeLayout extends StatelessWidget { height: ThemeProvider.margin16, ), Text( - context.localization.informYourPassHasBeenReset, + context.derivAuthLocalization.informYourPassHasBeenReset, style: TextStyles.title, ), const SizedBox( height: ThemeProvider.margin08, ), Text( - context.localization.informRedirectLogin, + context.derivAuthLocalization.informRedirectLogin, textAlign: TextAlign.center, style: context.theme.textStyle( textStyle: TextStyles.body1, diff --git a/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart b/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart index 50c3d9276..9d00ee918 100644 --- a/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart +++ b/packages/deriv_auth/lib/features/setting_page/presentation/layouts/deriv_setting_layout.dart @@ -153,7 +153,7 @@ class _SettingsPageState extends State { top: ThemeProvider.margin24, ), child: Text( - context.localization.labelDeveloper, + context.derivAuthLocalization.labelDeveloper, style: context.theme.textStyle( textStyle: TextStyles.body1Bold, color: context.theme.colors.coral, @@ -162,21 +162,21 @@ class _SettingsPageState extends State { ); Widget get _endpoint => _buildTextInputField( - label: context.localization.labelEndpoint, - semantic: context.localization.semanticEndpoint, + label: context.derivAuthLocalization.labelEndpoint, + semantic: context.derivAuthLocalization.semanticEndpoint, controller: _endpointController, validator: (String? value) => hasOnlySmallLettersAndNumberInput(value!) ? null - : context.localization.warnInvalidEndpoint, + : context.derivAuthLocalization.warnInvalidEndpoint, ); Widget get _appId => _buildTextInputField( - label: context.localization.labelApplicationID, - semantic: context.localization.semanticApplicationID, + label: context.derivAuthLocalization.labelApplicationID, + semantic: context.derivAuthLocalization.semanticApplicationID, controller: _appIdController, validator: (String? value) => hasOnlyNumberInput(value!) ? null - : context.localization.warnInvalidApplicationID, + : context.derivAuthLocalization.warnInvalidApplicationID, ); Widget _buildTextInputField({ diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart index b1c5c9d81..60c564e59 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_country_selection_layout.dart @@ -100,7 +100,7 @@ class _DerivCountrySelectionLayoutState SvgPicture.asset(Assets.locationIcon, package: 'deriv_auth'), const SizedBox(height: ThemeProvider.margin16), Text( - context.localization.labelSelectCountry, + context.derivAuthLocalization.labelSelectCountry, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin24), @@ -127,7 +127,7 @@ class _DerivCountrySelectionLayoutState key: _formKey, child: BaseTextField( controller: _textController, - labelText: context.localization.labelChooseCountry, + labelText: context.derivAuthLocalization.labelChooseCountry, labelColor: context.theme.colors.disabled, focusNode: _focusNode, focusedLabelColor: context.theme.colors.blue, @@ -157,7 +157,7 @@ class _DerivCountrySelectionLayoutState onPressed: widget.onNextPressed, child: Center( child: Text( - context.localization.actionNext, + context.derivAuthLocalization.actionNext, style: TextStyles.button .copyWith(color: context.theme.colors.prominent), ), @@ -225,7 +225,7 @@ class _DerivCountrySelectionLayoutState DerivResidenceModel? selectedCountry, }) { if (selectedCountry != null && selectedCountry.isDisabled) { - return context.localization.warnCountryNotAvailable; + return context.derivAuthLocalization.warnCountryNotAvailable; } return null; diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart index 2da5b9eff..115beb538 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_email_not_received_layout.dart @@ -42,7 +42,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { child: Column( children: [ Text( - context.localization.labelEmailIssueHeader, + context.derivAuthLocalization.labelEmailIssueHeader, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.general, @@ -55,7 +55,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.localization.labelEmailIssueSpam, + context.derivAuthLocalization.labelEmailIssueSpam, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -71,7 +71,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.localization.labelEmailIssueWrongEmail, + context.derivAuthLocalization.labelEmailIssueWrongEmail, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -87,7 +87,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.localization.labelEmailIssueTypo, + context.derivAuthLocalization.labelEmailIssueTypo, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -103,7 +103,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { const SizedBox(width: ThemeProvider.margin24), Flexible( child: Text( - context.localization.labelEmailIssueFirewall, + context.derivAuthLocalization.labelEmailIssueFirewall, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -127,7 +127,7 @@ class DerivEmailNotReceivedLayout extends StatelessWidget { onPressed: onReEnterEmailPressed, child: Center( child: Text( - context.localization.actionReenterEmail, + context.derivAuthLocalization.actionReenterEmail, style: context.theme.textStyle( textStyle: TextStyles.button .copyWith(color: context.theme.colors.prominent), diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart index 301e0944b..b08f83c61 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_set_password_layout.dart @@ -99,7 +99,7 @@ class _DerivSetPasswordLayoutState extends State { SvgPicture.asset(Assets.passwordIcon, package: 'deriv_auth'), const SizedBox(height: ThemeProvider.margin16), Text( - context.localization.labelKeepPassword, + context.derivAuthLocalization.labelKeepPassword, style: TextStyles.title, textAlign: TextAlign.center, ), @@ -142,7 +142,7 @@ class _DerivSetPasswordLayoutState extends State { focusNode: _passwordFocusNode, controller: _passwordTextController, obscureText: !_isPasswordVisible, - labelText: context.localization.labelCreatePassword, + labelText: context.derivAuthLocalization.labelCreatePassword, labelColor: context.theme.colors.disabled, focusedLabelColor: context.theme.colors.blue, suffixIcon: IconButton( @@ -168,7 +168,7 @@ class _DerivSetPasswordLayoutState extends State { strokeWidth: 3, ) : Text( - context.localization.actionStartTrading, + context.derivAuthLocalization.actionStartTrading, style: TextStyles.button .copyWith(color: context.theme.colors.prominent), ), @@ -183,7 +183,7 @@ class _DerivSetPasswordLayoutState extends State { onPressed: widget.onPreviousPressed, child: Center( child: Text( - context.localization.actionPrevious, + context.derivAuthLocalization.actionPrevious, style: context.theme.textStyle( textStyle: TextStyles.button, ), diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart index 7c3bcfe08..20910ea93 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_signup_layout.dart @@ -87,8 +87,8 @@ class _DerivSignupLayoutState extends State { backgroundColor: context.theme.colors.primary, appBar: AppBar( elevation: ThemeProvider.zeroMargin, - title: - Text(context.localization.labelSignUp, style: TextStyles.title), + title: Text(context.derivAuthLocalization.labelSignUp, + style: TextStyles.title), backgroundColor: context.theme.colors.secondary, ), body: DerivAuthStateListener( @@ -116,7 +116,7 @@ class _DerivSignupLayoutState extends State { _buildSignUpButton(), const SizedBox(height: ThemeProvider.margin24), DerivSocialAuthDivider( - label: context.localization.labelOrSignUpWith, + label: context.derivAuthLocalization.labelOrSignUpWith, isVisible: widget.isSocialAuthEnabled, ), if (widget.isSocialAuthEnabled) @@ -155,16 +155,17 @@ class _DerivSignupLayoutState extends State { Row( children: [ InfoIconButton( - dialogTitle: context.localization.labelReferralInfoTitle, + dialogTitle: + context.derivAuthLocalization.labelReferralInfoTitle, dialogDescription: - context.localization.infoReferralInfoDescription, - positiveActionLabel: context.localization.actionOk, + context.derivAuthLocalization.infoReferralInfoDescription, + positiveActionLabel: context.derivAuthLocalization.actionOk, iconSize: ThemeProvider.iconSize24, ), const SizedBox(width: ThemeProvider.margin08), Expanded( child: Text( - context.localization.labelGotReferralCode, + context.derivAuthLocalization.labelGotReferralCode, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.prominent, @@ -219,7 +220,7 @@ class _DerivSignupLayoutState extends State { } }, focusNode: referralFocusNode, - labelText: context.localization.labelReferralCode, + labelText: context.derivAuthLocalization.labelReferralCode, borderColor: context.theme.colors.hover, focusedBorderColor: context.theme.colors.blue, textInputAction: TextInputAction.done, @@ -252,7 +253,7 @@ class _DerivSignupLayoutState extends State { mainAxisSize: MainAxisSize.min, children: [ Text( - context.localization.labelHaveAccount, + context.derivAuthLocalization.labelHaveAccount, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -263,7 +264,7 @@ class _DerivSignupLayoutState extends State { child: Padding( padding: const EdgeInsets.all(ThemeProvider.margin04), child: Text( - context.localization.actionLogin, + context.derivAuthLocalization.actionLogin, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.coral, @@ -279,7 +280,7 @@ class _DerivSignupLayoutState extends State { semanticLabel: SemanticsLabels.signupEmailFieldSemantic, controller: emailController, focusNode: emailFocusNode, - labelText: context.localization.labelEmail, + labelText: context.derivAuthLocalization.labelEmail, borderColor: context.theme.colors.hover, focusedBorderColor: context.theme.colors.blue, keyboardType: TextInputType.emailAddress, @@ -307,7 +308,7 @@ class _DerivSignupLayoutState extends State { width: ThemeProvider.iconSize16, ) : Text( - context.localization.actionCreateAccount, + context.derivAuthLocalization.actionCreateAccount, style: context.theme.textStyle( textStyle: TextStyles.body2, color: context.theme.colors.prominent, @@ -337,7 +338,7 @@ class _DerivSignupLayoutState extends State { return null; } - return context.localization.informInvalidEmailFormat; + return context.derivAuthLocalization.informInvalidEmailFormat; } String? _referralValidator(String? input) { @@ -345,7 +346,7 @@ class _DerivSignupLayoutState extends State { return null; } - return context.localization.informInvalidReferralCode; + return context.derivAuthLocalization.informInvalidReferralCode; } Future _onSignupTapped() async { diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart index 672539fe8..1e30b4649 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verification_done_layout.dart @@ -29,7 +29,7 @@ class DerivVerificationDoneLayout extends StatelessWidget { backgroundColor: context.theme.colors.primary, appBar: AppBar( elevation: ThemeProvider.zeroMargin, - title: Text(context.localization.labelVerifyYourEmail), + title: Text(context.derivAuthLocalization.labelVerifyYourEmail), ), body: SafeArea( child: Column( @@ -56,12 +56,12 @@ class DerivVerificationDoneLayout extends StatelessWidget { ), const SizedBox(height: ThemeProvider.margin16), Text( - context.localization.labelThanksEmail, + context.derivAuthLocalization.labelThanksEmail, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.localization.informLetsContinue, + context.derivAuthLocalization.informLetsContinue, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -80,7 +80,7 @@ class DerivVerificationDoneLayout extends StatelessWidget { onPressed: onContinuePressed, child: Center( child: Text( - context.localization.actionContinue, + context.derivAuthLocalization.actionContinue, style: context.theme.textStyle( textStyle: TextStyles.button .copyWith(color: context.theme.colors.prominent), diff --git a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart index facf31332..eb2996d7d 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/layouts/deriv_verify_email_layout.dart @@ -26,7 +26,7 @@ class DerivVerifyEmailLayout extends StatelessWidget { appBar: AppBar( elevation: ThemeProvider.zeroMargin, title: Text( - context.localization.labelVerifyYourEmail, + context.derivAuthLocalization.labelVerifyYourEmail, style: TextStyles.title, ), backgroundColor: context.theme.colors.secondary, @@ -56,12 +56,12 @@ class DerivVerifyEmailLayout extends StatelessWidget { ), const SizedBox(height: ThemeProvider.margin16), Text( - context.localization.labelCheckEmail, + context.derivAuthLocalization.labelCheckEmail, style: TextStyles.title, ), const SizedBox(height: ThemeProvider.margin08), Text( - context.localization.informVerificationEmailSent(email!), + context.derivAuthLocalization.informVerificationEmailSent(email!), style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general, @@ -81,7 +81,7 @@ class DerivVerifyEmailLayout extends StatelessWidget { onPressed: onEmailNotReceivedPressed, child: Center( child: Text( - context.localization.actionEmailNotReceived, + context.derivAuthLocalization.actionEmailNotReceived, style: context.theme.textStyle( textStyle: TextStyles.button, ), diff --git a/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart b/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart index 11e0c5f75..5b72f3fc0 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/widgets/country_selection_list_widget.dart @@ -102,7 +102,7 @@ class _CountrySelectionListWidgetState children: [ const SizedBox(width: ThemeProvider.margin48), Text( - context.localization.labelChooseCountry, + context.derivAuthLocalization.labelChooseCountry, style: TextStyles.subheading, ), ], @@ -128,7 +128,7 @@ class _CountrySelectionListWidgetState onPressed: () => _searchController.clear(), ), contentPadding: const EdgeInsets.only(top: ThemeProvider.margin08), - hintText: context.localization.labelSearchCountry, + hintText: context.derivAuthLocalization.labelSearchCountry, hintStyle: context.theme.textStyle( textStyle: TextStyles.subheading, color: context.theme.colors.active, diff --git a/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart b/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart index dddddde12..2bb6c1b5b 100644 --- a/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart +++ b/packages/deriv_auth/lib/features/signup/presentation/widgets/password_policy_checker_widget.dart @@ -40,19 +40,20 @@ class PasswordPolicyCheckerWidget extends StatelessWidget { BuildContext context) => [ DerivPasswordPolicyModel( - description: context.localization.informPasswordPolicyLength, + description: context.derivAuthLocalization.informPasswordPolicyLength, regex: validPasswordLengthRegex, ), DerivPasswordPolicyModel( - description: context.localization.informPasswordPolicyLowerAndUpper, + description: + context.derivAuthLocalization.informPasswordPolicyLowerAndUpper, regex: validPasswordWithUppercaseRegex, ), DerivPasswordPolicyModel( - description: context.localization.informPasswordPolicyNumber, + description: context.derivAuthLocalization.informPasswordPolicyNumber, regex: validPasswordWithNumberRegex, ), DerivPasswordPolicyModel( - description: context.localization.warnPasswordContainsSymbol, + description: context.derivAuthLocalization.warnPasswordContainsSymbol, regex: validPasswordWithSymbols, isOptional: true, ), @@ -66,7 +67,7 @@ class PasswordPolicyCheckerWidget extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Text( - context.localization.informPasswordPolicy, + context.derivAuthLocalization.informPasswordPolicy, style: context.theme.textStyle( textStyle: TextStyles.body1, color: context.theme.colors.general,