From 51be791a3a3bbf0f2889f7d2d12b390cefb95047 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sun, 25 Apr 2021 12:47:20 +0800 Subject: [PATCH] more zh --- flutter_hbb/lib/common.dart | 9 ++++++--- flutter_hbb/lib/home_page.dart | 2 +- flutter_hbb/lib/remote_page.dart | 8 ++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/flutter_hbb/lib/common.dart b/flutter_hbb/lib/common.dart index 10a042e68..455a2e7d8 100644 --- a/flutter_hbb/lib/common.dart +++ b/flutter_hbb/lib/common.dart @@ -21,6 +21,7 @@ final langs = >{ 'Retry': '再试', 'OK': '确认', 'Password Required': '需要密码', + 'Enter your password': '输入你的密码', 'Please enter your password': '请输入密码', 'Remember password': '记住密码', 'Wrong Password': '密码错误', @@ -56,6 +57,7 @@ final langs = >{ 'Failed to connect via rendezvous server': '无法通过服务器建立连接', 'Failed to make direct connection to remote desktop': '无法建立直接连接', 'OS Password': '操作系统密码', + 'Password': '密码', 'Paste': '粘贴', 'Logging in...': '正在登录...', 'Are you sure to close the connection?': '是否确认关闭连接?', @@ -142,7 +144,8 @@ void msgbox(String type, String title, String text, BuildContext context, child: FlatButton( focusColor: MyTheme.accent, onPressed: onPressed, - child: Text(text, style: TextStyle(color: MyTheme.accent)))); + child: + Text(translate(text), style: TextStyle(color: MyTheme.accent)))); dismissLoading(); if (_hasDialog) { @@ -200,8 +203,8 @@ class _PasswordWidgetState extends State { obscureText: !_passwordVisible, //This will obscure text dynamically keyboardType: TextInputType.visiblePassword, decoration: InputDecoration( - labelText: 'Password', - hintText: 'Enter your password', + labelText: translate('Password'), + hintText: translate('Enter your password'), // Here is key idea suffixIcon: IconButton( icon: Icon( diff --git a/flutter_hbb/lib/home_page.dart b/flutter_hbb/lib/home_page.dart index 6f63ad0d6..08b4ab532 100644 --- a/flutter_hbb/lib/home_page.dart +++ b/flutter_hbb/lib/home_page.dart @@ -305,7 +305,7 @@ void showServer(BuildContext context) { onPressed: () { Navigator.pop(context); }, - child: Text('Cancel'), + child: Text(translate('Cancel')), ), FlatButton( textColor: MyTheme.accent, diff --git a/flutter_hbb/lib/remote_page.dart b/flutter_hbb/lib/remote_page.dart index ad29bf11c..4cf055088 100644 --- a/flutter_hbb/lib/remote_page.dart +++ b/flutter_hbb/lib/remote_page.dart @@ -368,7 +368,7 @@ class _RemotePageState extends State { color: active == true ? MyTheme.accent80 : null, child: icon != null ? Icon(icon, size: 17, color: Colors.white) - : Text(text, + : Text(translate(text), style: TextStyle(color: Colors.white, fontSize: 11)), onPressed: onPressed)); }; @@ -579,7 +579,7 @@ void enterPasswordDialog(String id, BuildContext context) { showAlertDialog( context, (setState) => Tuple3( - Text(translate('Password required')), + Text(translate('Password Required')), Column(mainAxisSize: MainAxisSize.min, children: [ PasswordWidget(controller: controller), CheckboxListTile( @@ -780,7 +780,7 @@ void showActions(BuildContext context) { more.add(PopupMenuItem( child: Row( children: ([ - Text('OS Password'), + Text(translate('OS Password')), FlatButton( textColor: MyTheme.accent, onPressed: () { @@ -845,7 +845,7 @@ void showSetOSPassword(BuildContext context) async { showAlertDialog( context, (setState) => Tuple3( - Text(translate('Password required')), + Text(translate('Password Required')), Column(mainAxisSize: MainAxisSize.min, children: [ PasswordWidget(controller: controller), ]),