Language Change

This commit is contained in:
Nilanjan Chakrabarti
2025-07-10 13:19:31 +05:30
parent 9b439338a9
commit d4de89a91f
22 changed files with 334 additions and 227 deletions

View File

@@ -1,3 +1,5 @@
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'dart:developer';
import 'package:flutter/material.dart';
@@ -44,7 +46,7 @@ class _MPinScreenState extends State<MPinScreen> {
final auth = LocalAuthentication();
if (await auth.canCheckBiometrics) {
final didAuth = await auth.authenticate(
localizedReason: 'Authenticate to access kMobile',
localizedReason: AppLocalizations.of(context).authenticateToAccess,
options: const AuthenticationOptions(biometricOnly: true),
);
if (didAuth && mounted) {
@@ -91,7 +93,7 @@ class _MPinScreenState extends State<MPinScreen> {
widget.onCompleted?.call(pin);
} else {
setState(() {
errorText = "Incorrect mPIN. Try again.";
errorText = AppLocalizations.of(context).incorrectMPIN;
mPin.clear();
});
}
@@ -123,7 +125,7 @@ class _MPinScreenState extends State<MPinScreen> {
}
} else {
setState(() {
errorText = "Pins do not match. Try again.";
errorText = AppLocalizations.of(context).pinsDoNotMatch;
mPin.clear();
});
}
@@ -172,7 +174,8 @@ class _MPinScreenState extends State<MPinScreen> {
_handleComplete();
} else {
setState(() {
errorText = "Please enter 4 digits";
errorText =
AppLocalizations.of(context).pleaseEnter4Digits;
});
}
} else if (key.isNotEmpty) {
@@ -208,11 +211,11 @@ class _MPinScreenState extends State<MPinScreen> {
String getTitle() {
switch (widget.mode) {
case MPinMode.enter:
return "Enter your mPIN";
return AppLocalizations.of(context).enterMPIN;
case MPinMode.set:
return "Set your new mPIN";
return AppLocalizations.of(context).setMPIN;
case MPinMode.confirm:
return "Confirm your mPIN";
return AppLocalizations.of(context).confirmMPIN;
}
}