feat: add App title and welcome message in personal info page english translate

This commit is contained in:
JingChiang
2024-11-30 13:45:18 +08:00
parent 00ff77a49a
commit 57968f7935
10 changed files with 40 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ class _HomePageState extends State<HomePage> {
),
Center(
child: Text(
'全方位照護守護者',
S.of(context).app_name,
style: TextStyle(fontSize: 24, height: 5),
),
),

View File

@@ -47,7 +47,7 @@ class _MessagePageState extends State<MessagePage> {
),
Center(
child: Text(
'全方位照護守護者',
S.of(context).app_name,
style: TextStyle(fontSize: 24, height: 5),
),
),

View File

@@ -160,7 +160,7 @@ class _PersonalInfoState extends State<PersonalInfo> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
_username + ' 您好',
S.of(context).welcome_message(_username),
style: TextStyle(fontSize: 28, color: Colors.black),
),
],

View File

@@ -255,7 +255,7 @@ class _RegisterPageState extends State<RegisterPage> {
),
),
Text(
'全方位照護守護者',
S.of(context).app_name,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,

View File

@@ -31,12 +31,16 @@ class MessageLookup extends MessageLookupByLibrary {
static String m4(displayIndex) => "ID: ${displayIndex}";
static String m5(username) => "Welcome, ${username}!";
final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
"account_setting": MessageLookupByLibrary.simpleMessage("Account"),
"additional_information":
MessageLookupByLibrary.simpleMessage("Knowledge"),
"address": MessageLookupByLibrary.simpleMessage("Address"),
"app_name":
MessageLookupByLibrary.simpleMessage("Comprehensive Care Guardian"),
"basic_information_setting":
MessageLookupByLibrary.simpleMessage("Basic Information"),
"call_phone":
@@ -99,6 +103,7 @@ class MessageLookup extends MessageLookupByLibrary {
"register_turn_back":
MessageLookupByLibrary.simpleMessage("Return to Login Page"),
"save": MessageLookupByLibrary.simpleMessage("Save"),
"switch_camera": MessageLookupByLibrary.simpleMessage("Switch View")
"switch_camera": MessageLookupByLibrary.simpleMessage("Switch View"),
"welcome_message": m5
};
}

View File

@@ -31,11 +31,14 @@ class MessageLookup extends MessageLookupByLibrary {
static String m4(displayIndex) => "編號: ${displayIndex}";
static String m5(username) => "${username} 您好!";
final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
"account_setting": MessageLookupByLibrary.simpleMessage("帳號設定"),
"additional_information": MessageLookupByLibrary.simpleMessage("知識補充"),
"address": MessageLookupByLibrary.simpleMessage("地址"),
"app_name": MessageLookupByLibrary.simpleMessage("全方位照護守護者"),
"basic_information_setting":
MessageLookupByLibrary.simpleMessage("基本資料"),
"call_phone": MessageLookupByLibrary.simpleMessage("撥打電話"),
@@ -89,6 +92,7 @@ class MessageLookup extends MessageLookupByLibrary {
"register_success": MessageLookupByLibrary.simpleMessage("註冊成功"),
"register_turn_back": MessageLookupByLibrary.simpleMessage("返回登入頁面"),
"save": MessageLookupByLibrary.simpleMessage("儲存變更"),
"switch_camera": MessageLookupByLibrary.simpleMessage("切換畫面")
"switch_camera": MessageLookupByLibrary.simpleMessage("切換畫面"),
"welcome_message": m5
};
}

View File

@@ -50,6 +50,16 @@ class S {
return Localizations.of<S>(context, S);
}
/// `Comprehensive Care Guardian`
String get app_name {
return Intl.message(
'Comprehensive Care Guardian',
name: 'app_name',
desc: '',
args: [],
);
}
/// `Email/Username`
String get email_label {
return Intl.message(
@@ -270,6 +280,16 @@ class S {
);
}
/// `Welcome, {username}!`
String welcome_message(Object username) {
return Intl.message(
'Welcome, $username!',
name: 'welcome_message',
desc: '',
args: [username],
);
}
/// `Basic Information`
String get basic_information_setting {
return Intl.message(

View File

@@ -1,4 +1,5 @@
{
"app_name": "Comprehensive Care Guardian",
"email_label": "Email/Username",
"password_label": "Password",
"login_button": "Login",
@@ -25,6 +26,7 @@
"home": "Home",
"welcome_message": "Welcome, {username}!",
"basic_information_setting": "Basic Information",
"account_setting": "Account",
"language_setting": "Language",

View File

@@ -1,4 +1,5 @@
{
"app_name": "全方位照護守護者",
"email_label": "電子信箱/帳號",
"password_label": "密碼",
"login_button": "登入",
@@ -25,6 +26,7 @@
"home": "首頁",
"welcome_message": "{username} 您好!",
"basic_information_setting": "基本資料",
"account_setting": "帳號設定",
"language_setting": "語言設定",

View File

@@ -186,7 +186,7 @@ class _LoginPageState extends State<LoginPage> {
),
),
Text(
'全方位照護守護者',
S.of(context).app_name,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,