[mob][auth] Extract strings

This commit is contained in:
ashilkn
2024-07-23 17:11:16 +05:30
parent 439a7771b0
commit 8a35b71bb8
9 changed files with 70 additions and 34 deletions

View File

@@ -445,5 +445,16 @@
"updateNotAvailable": "Update not available",
"viewRawCodes": "View raw codes",
"rawCodes": "Raw codes",
"rawCodeData": "Raw code data"
"rawCodeData": "Raw code data",
"appLock": "App lock",
"noSystemLockFound": "No system lock found",
"toEnableAppLockPleaseSetupDevicePasscodeOrScreen": "To enable app lock, please setup device passcode or screen lock in your system settings.",
"autoLock": "Auto lock",
"immediately": "Immediately",
"reEnterPassword": "Re-enter password",
"reEnterPin": "Re-enter PIN",
"next": "Next",
"tooManyIncorrectAttempts": "Too many incorrect attempts",
"tapToUnlock": "Tap to unlock",
"setNewPassword": "Set new password"
}

View File

@@ -1,3 +1,4 @@
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/theme/ente_theme.dart';
import 'package:ente_auth/ui/components/captioned_text_widget.dart';
import 'package:ente_auth/ui/components/divider_widget.dart';
@@ -22,9 +23,9 @@ class _LockScreenAutoLockState extends State<LockScreenAutoLock> {
body: CustomScrollView(
primary: false,
slivers: <Widget>[
const TitleBarWidget(
TitleBarWidget(
flexibleSpaceTitle: TitleBarTitleWidget(
title: "Auto lock",
title: context.l10n.autoLock,
),
),
SliverList(
@@ -136,7 +137,7 @@ class _AutoLockItemsState extends State<AutoLockItems> {
} else if (duration.inSeconds != 0) {
return "${duration.inSeconds}s";
} else {
return "Immediately";
return context.l10n.immediately;
}
}
}

View File

@@ -1,3 +1,4 @@
import "package:ente_auth/l10n/l10n.dart";
import "package:ente_auth/theme/ente_theme.dart";
import "package:ente_auth/ui/common/dynamic_fab.dart";
import "package:ente_auth/ui/components/buttons/icon_button_widget.dart";
@@ -87,7 +88,7 @@ class _LockScreenConfirmPasswordState extends State<LockScreenConfirmPassword> {
builder: (context, isFormValid, child) {
return DynamicFAB(
isKeypadOpen: isKeypadOpen,
buttonText: "Confirm",
buttonText: context.l10n.confirm,
isFormValid: isFormValid,
onPressedFunction: () async {
_submitNotifier.value = !_submitNotifier.value;
@@ -152,14 +153,14 @@ class _LockScreenConfirmPasswordState extends State<LockScreenConfirmPassword> {
),
),
Text(
"Re-enter Password",
context.l10n.reEnterPassword,
style: textTheme.bodyBold,
),
const Padding(padding: EdgeInsets.all(12)),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: TextInputWidget(
hintText: "Confirm Password",
hintText: context.l10n.confirmPassword,
autoFocus: true,
textCapitalization: TextCapitalization.none,
isPasswordInput: true,

View File

@@ -1,5 +1,6 @@
import "dart:io";
import "package:ente_auth/l10n/l10n.dart";
import "package:ente_auth/theme/ente_theme.dart";
import "package:ente_auth/ui/settings/lock_screen/custom_pin_keypad.dart";
import "package:ente_auth/utils/lock_screen_settings.dart";
@@ -158,7 +159,7 @@ class _LockScreenConfirmPinState extends State<LockScreenConfirmPin> {
),
),
Text(
"Re-enter PIN",
context.l10n.reEnterPin,
style: textTheme.bodyBold,
),
const Padding(padding: EdgeInsets.all(12)),

View File

@@ -1,5 +1,6 @@
import "dart:convert";
import "package:ente_auth/l10n/l10n.dart";
import "package:ente_auth/theme/ente_theme.dart";
import "package:ente_auth/ui/common/dynamic_fab.dart";
import "package:ente_auth/ui/components/buttons/icon_button_widget.dart";
@@ -98,7 +99,7 @@ class _LockScreenPasswordState extends State<LockScreenPassword> {
builder: (context, isFormValid, child) {
return DynamicFAB(
isKeypadOpen: isKeypadOpen,
buttonText: "Next",
buttonText: context.l10n.next,
isFormValid: isFormValid,
onPressedFunction: () async {
_submitNotifier.value = !_submitNotifier.value;
@@ -164,8 +165,8 @@ class _LockScreenPasswordState extends State<LockScreenPassword> {
),
Text(
widget.isChangingLockScreenSettings
? "Enter Password"
: "Set new Password",
? context.l10n.enterPassword
: context.l10n.setNewPassword,
textAlign: TextAlign.center,
style: textTheme.bodyBold,
),
@@ -173,7 +174,7 @@ class _LockScreenPasswordState extends State<LockScreenPassword> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: TextInputWidget(
hintText: "Password",
hintText: context.l10n.password,
autoFocus: true,
textCapitalization: TextCapitalization.none,
isPasswordInput: true,

View File

@@ -137,8 +137,8 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
}
children.addAll([
MenuItemWidget(
captionedTextWidget: const CaptionedTextWidget(
title: "App lock",
captionedTextWidget: CaptionedTextWidget(
title: context.l10n.appLock,
),
trailingIcon: Icons.chevron_right_outlined,
trailingIconIsMuted: true,
@@ -146,7 +146,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
if (await LocalAuthentication().isDeviceSupported()) {
final bool result = await requestAuthentication(
context,
"Please authenticate to change lockscreen setting",
context.l10n.authToChangeLockscreenSetting,
);
if (result) {
await Navigator.of(context).push(
@@ -160,8 +160,8 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
} else {
await showErrorDialog(
context,
"No system lock found",
"To enable app lock, please setup device passcode or screen lock in your system settings.",
context.l10n.noSystemLockFound,
context.l10n.toEnableAppLockPleaseSetupDevicePasscodeOrScreen,
);
}
},

View File

@@ -149,7 +149,7 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {
alignment: Alignment.center,
children: [
Text(
"Too many incorrect attempts",
context.l10n.tooManyIncorrectAttempts,
style: textTheme.small,
)
.animate(
@@ -175,7 +175,7 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {
: GestureDetector(
onTap: () => _showLockScreen(source: "tap"),
child: Text(
"Tap to unlock",
context.l10n.tapToUnlock,
style: textTheme.small,
),
),
@@ -201,8 +201,8 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {
void _onLogoutTapped(BuildContext context) {
showChoiceActionSheet(
context,
title: "Are you sure you want to logout?",
firstButtonLabel: "Yes, logout",
title: context.l10n.areYouSureYouWantToLogout,
firstButtonLabel: context.l10n.yesLogout,
isCritical: true,
firstButtonOnTap: () async {
await UserService.instance.logout(context);

View File

@@ -102,10 +102,6 @@ class _TwoFactorAuthenticationPageState
),
),
),
// submittedFieldDecoration: _pinPutDecoration.copyWith(
// borderRadius: BorderRadius.circular(20.0),
// ),
// selectedFieldDecoration: _pinPutDecoration,
defaultPinTheme: _pinPutDecoration,
followingPinTheme: _pinPutDecoration.copyWith(
decoration: BoxDecoration(
@@ -115,13 +111,6 @@ class _TwoFactorAuthenticationPageState
),
),
),
// followingFieldDecoration: _pinPutDecoration.copyWith(
// borderRadius: BorderRadius.circular(5.0),
// border: Border.all(
// color: const Color.fromRGBO(45, 194, 98, 0.5),
// ),
// ),
autofocus: true,
),
),

View File

@@ -440,6 +440,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_animate:
dependency: "direct main"
description:
name: flutter_animate
sha256: "7c8a6594a9252dad30cc2ef16e33270b6248c4dedc3b3d06c86c4f3f4dc05ae5"
url: "https://pub.dev"
source: hosted
version: "4.5.0"
flutter_bloc:
dependency: "direct main"
description:
@@ -639,6 +647,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.2"
flutter_shaders:
dependency: transitive
description:
name: flutter_shaders
sha256: "02750b545c01ff4d8e9bbe8f27a7731aa3778402506c67daa1de7f5fc3f4befe"
url: "https://pub.dev"
source: hosted
version: "0.1.2"
flutter_slidable:
dependency: "direct main"
description:
@@ -1133,10 +1149,10 @@ packages:
dependency: "direct main"
description:
name: pinput
sha256: "27eb69042f75755bdb6544f6e79a50a6ed09d6e97e2d75c8421744df1e392949"
sha256: "543da5bfdefd9e06914a12100f8c9156f84cef3efc14bca507c49e966c5b813b"
url: "https://pub.dev"
source: hosted
version: "1.2.2"
version: "2.3.0"
platform:
dependency: transitive
description:
@@ -1358,6 +1374,14 @@ packages:
description: flutter
source: sdk
version: "0.0.99"
smart_auth:
dependency: transitive
description:
name: smart_auth
sha256: a25229b38c02f733d0a4e98d941b42bed91a976cb589e934895e60ccfa674cf6
url: "https://pub.dev"
source: hosted
version: "1.1.1"
sodium:
dependency: transitive
description:
@@ -1575,6 +1599,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.2.2"
universal_platform:
dependency: transitive
description:
name: universal_platform
sha256: "64e16458a0ea9b99260ceb5467a214c1f298d647c659af1bff6d3bf82536b1ec"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
url_launcher:
dependency: "direct main"
description: