feat(mobile): added more translations (#1805)

This commit is contained in:
Michel Heusschen
2023-02-20 18:22:35 +01:00
committed by GitHub
parent 9bfb4dfd06
commit e408e8ca4a
8 changed files with 60 additions and 31 deletions

View File

@@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
@@ -30,7 +31,7 @@ class ChangePasswordForm extends HookConsumerWidget {
alignment: WrapAlignment.start,
children: [
Text(
'Change Password',
'common_change_password'.tr(),
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
@@ -40,7 +41,12 @@ class ChangePasswordForm extends HookConsumerWidget {
Padding(
padding: const EdgeInsets.symmetric(vertical: 24.0),
child: Text(
'Hi ${authState.firstName} ${authState.lastName},\n\nThis is either the first time you are signing into the system or a request has been made to change your password. Please enter the new password below.',
'change_password_form_description'.tr(
namedArgs: {
'firstName': authState.firstName,
'lastName': authState.lastName,
},
),
style: TextStyle(
fontSize: 14,
color: Colors.grey[700],
@@ -85,10 +91,10 @@ class PasswordInput extends StatelessWidget {
return TextFormField(
obscureText: true,
controller: controller,
decoration: const InputDecoration(
labelText: 'New Password',
border: OutlineInputBorder(),
hintText: 'New Password',
decoration: InputDecoration(
labelText: 'change_password_form_new_password'.tr(),
border: const OutlineInputBorder(),
hintText: 'change_password_form_new_password'.tr(),
),
);
}
@@ -106,7 +112,7 @@ class ConfirmPasswordInput extends StatelessWidget {
String? _validateInput(String? email) {
if (confirmController.value != originalController.value) {
return 'Passwords do not match';
return 'change_password_form_password_mismatch'.tr();
}
return null;
}
@@ -116,10 +122,10 @@ class ConfirmPasswordInput extends StatelessWidget {
return TextFormField(
obscureText: true,
controller: confirmController,
decoration: const InputDecoration(
labelText: 'Confirm Password',
hintText: 'Re-enter New Password',
border: OutlineInputBorder(),
decoration: InputDecoration(
labelText: 'change_password_form_confirm_password'.tr(),
hintText: 'change_password_form_reenter_new_password'.tr(),
border: const OutlineInputBorder(),
),
validator: _validateInput,
autovalidateMode: AutovalidateMode.always,
@@ -166,9 +172,9 @@ class ChangePasswordButton extends ConsumerWidget {
}
}
},
child: const Text(
"Change Password",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
child: Text(
'common_change_password'.tr(),
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
),
);
}