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 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:kmobile/di/injection.dart';
@@ -110,8 +112,8 @@ class LoginScreenState extends State<LoginScreen>
),
const SizedBox(height: 16),
// Title
const Text(
'KCCB',
Text(
AppLocalizations.of(context).kccb,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
@@ -121,8 +123,8 @@ class LoginScreenState extends State<LoginScreen>
TextFormField(
controller: _customerNumberController,
decoration: const InputDecoration(
labelText: 'Customer Number',
decoration: InputDecoration(
labelText: AppLocalizations.of(context).customerNumber,
// prefixIcon: Icon(Icons.person),
border: OutlineInputBorder(),
isDense: true,
@@ -139,7 +141,7 @@ class LoginScreenState extends State<LoginScreen>
textInputAction: TextInputAction.next,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter your username';
return AppLocalizations.of(context).pleaseEnterUsername;
}
return null;
},
@@ -153,7 +155,7 @@ class LoginScreenState extends State<LoginScreen>
onFieldSubmitted: (_) =>
_submitForm(), // ⌨️ Enter key submits
decoration: InputDecoration(
labelText: 'Password',
labelText: AppLocalizations.of(context).password,
border: const OutlineInputBorder(),
isDense: true,
filled: true,
@@ -179,7 +181,7 @@ class LoginScreenState extends State<LoginScreen>
),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter your password';
return AppLocalizations.of(context).pleaseEnterPassword;
}
return null;
},
@@ -200,22 +202,22 @@ class LoginScreenState extends State<LoginScreen>
),
child: state is AuthLoading
? const CircularProgressIndicator()
: const Text(
"Login",
: Text(
AppLocalizations.of(context).login,
style: TextStyle(fontSize: 16),
),
),
),
const SizedBox(height: 15),
const Padding(
Padding(
padding: EdgeInsets.symmetric(vertical: 16),
child: Row(
children: [
Expanded(child: Divider()),
Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Text('OR'),
child: Text(AppLocalizations.of(context).or),
),
Expanded(child: Divider()),
],
@@ -235,7 +237,7 @@ class LoginScreenState extends State<LoginScreen>
padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: Colors.lightBlue[100],
foregroundColor: Colors.black),
child: const Text('Register'),
child: Text(AppLocalizations.of(context).register),
),
),
],
@@ -471,4 +473,4 @@ class LoginScreenState extends State<LoginScreen> {
);
}
}
*/
*/