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

@@ -14,7 +14,7 @@ import 'features/auth/screens/welcome_screen.dart';
import 'features/auth/screens/login_screen.dart';
import 'features/service/screens/service_screen.dart';
import 'features/dashboard/screens/dashboard_screen.dart';
//import 'package:material_symbols_icons/material_symbols_icons.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import 'features/auth/screens/mpin_screen.dart';
import 'package:local_auth/local_auth.dart';
@@ -186,7 +186,7 @@ class _AuthGateState extends State<AuthGate> {
if (!canCheck) return false;
try {
final didAuth = await localAuth.authenticate(
localizedReason: 'Authenticate to access kMobile',
localizedReason: AppLocalizations.of(context).authenticateToAccess,
options: const AuthenticationOptions(
stickyAuth: true,
biometricOnly: true,
@@ -353,18 +353,19 @@ class _AuthGateState extends State<AuthGate> {
context: context,
barrierDismissible: false,
builder: (ctx) => AlertDialog(
title: const Text('Enable Fingerprint Login?'),
content: const Text(
'Would you like to enable fingerprint authentication for faster login?',
title:
Text(AppLocalizations.of(context).enableFingerprintLogin),
content: Text(
AppLocalizations.of(context).enableFingerprintMessage,
),
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(false),
child: const Text('No'),
child: Text(AppLocalizations.of(context).no),
),
TextButton(
onPressed: () => Navigator.of(ctx).pop(true),
child: const Text('Yes'),
child: Text(AppLocalizations.of(context).yes),
),
],
),
@@ -376,7 +377,8 @@ class _AuthGateState extends State<AuthGate> {
if (canCheck) {
didAuth = await localAuth.authenticate(
localizedReason: 'Authenticate to enable fingerprint login.',
localizedReason:
AppLocalizations.of(context).authenticateToEnable,
options: const AuthenticationOptions(
stickyAuth: true,
biometricOnly: true,
@@ -449,16 +451,16 @@ class _NavigationScaffoldState extends State<NavigationScaffold> {
final shouldExit = await showDialog<bool>(
context: context,
builder: (context) => AlertDialog(
title: const Text('Exit App'),
content: const Text('Do you really want to exit?'),
title: Text(AppLocalizations.of(context).exitApp),
content: Text(AppLocalizations.of(context).exitConfirmation),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(false),
child: const Text('No'),
child: Text(AppLocalizations.of(context).no),
),
TextButton(
onPressed: () => Navigator.of(context).pop(true),
child: const Text('Yes'),
child: Text(AppLocalizations.of(context).yes),
),
],
),
@@ -515,7 +517,7 @@ class SplashScreen extends StatelessWidget {
children: [
const CircularProgressIndicator(),
const SizedBox(height: 20),
Text('Loading...',
Text(AppLocalizations.of(context).loading,
style: Theme.of(context).textTheme.headlineMedium),
],
),
@@ -537,7 +539,7 @@ class BiometricPromptScreen extends StatelessWidget {
return;
}
final didAuth = await localAuth.authenticate(
localizedReason: 'Enable fingerprint authentication for quick login?',
localizedReason: AppLocalizations.of(context).enableFingerprintQuick,
options: const AuthenticationOptions(
stickyAuth: true,
biometricOnly: true,
@@ -563,21 +565,20 @@ class BiometricPromptScreen extends StatelessWidget {
context: context,
barrierDismissible: true,
builder: (ctx) => AlertDialog(
title: const Text('Enable Fingerprint Login?'),
content: const Text(
'Would you like to enable fingerprint authentication for faster login?'),
title: Text(AppLocalizations.of(context).enableFingerprintLogin),
content: Text(AppLocalizations.of(context).enableFingerprintMessage),
actions: [
TextButton(
onPressed: () {
Navigator.of(ctx).pop(false);
},
child: const Text('No'),
child: Text(AppLocalizations.of(context).no),
),
TextButton(
onPressed: () {
Navigator.of(ctx).pop(true);
},
child: const Text('Yes'),
child: Text(AppLocalizations.of(context).yes),
),
],
),