This commit is contained in:
rustdesk 2021-04-25 12:47:20 +08:00
parent c34e128945
commit 51be791a3a
3 changed files with 11 additions and 8 deletions

View File

@ -21,6 +21,7 @@ final langs = <String, Map<String, String>>{
'Retry': '再试', 'Retry': '再试',
'OK': '确认', 'OK': '确认',
'Password Required': '需要密码', 'Password Required': '需要密码',
'Enter your password': '输入你的密码',
'Please enter your password': '请输入密码', 'Please enter your password': '请输入密码',
'Remember password': '记住密码', 'Remember password': '记住密码',
'Wrong Password': '密码错误', 'Wrong Password': '密码错误',
@ -56,6 +57,7 @@ final langs = <String, Map<String, String>>{
'Failed to connect via rendezvous server': '无法通过服务器建立连接', 'Failed to connect via rendezvous server': '无法通过服务器建立连接',
'Failed to make direct connection to remote desktop': '无法建立直接连接', 'Failed to make direct connection to remote desktop': '无法建立直接连接',
'OS Password': '操作系统密码', 'OS Password': '操作系统密码',
'Password': '密码',
'Paste': '粘贴', 'Paste': '粘贴',
'Logging in...': '正在登录...', 'Logging in...': '正在登录...',
'Are you sure to close the connection?': '是否确认关闭连接?', 'Are you sure to close the connection?': '是否确认关闭连接?',
@ -142,7 +144,8 @@ void msgbox(String type, String title, String text, BuildContext context,
child: FlatButton( child: FlatButton(
focusColor: MyTheme.accent, focusColor: MyTheme.accent,
onPressed: onPressed, onPressed: onPressed,
child: Text(text, style: TextStyle(color: MyTheme.accent)))); child:
Text(translate(text), style: TextStyle(color: MyTheme.accent))));
dismissLoading(); dismissLoading();
if (_hasDialog) { if (_hasDialog) {
@ -200,8 +203,8 @@ class _PasswordWidgetState extends State<PasswordWidget> {
obscureText: !_passwordVisible, //This will obscure text dynamically obscureText: !_passwordVisible, //This will obscure text dynamically
keyboardType: TextInputType.visiblePassword, keyboardType: TextInputType.visiblePassword,
decoration: InputDecoration( decoration: InputDecoration(
labelText: 'Password', labelText: translate('Password'),
hintText: 'Enter your password', hintText: translate('Enter your password'),
// Here is key idea // Here is key idea
suffixIcon: IconButton( suffixIcon: IconButton(
icon: Icon( icon: Icon(

View File

@ -305,7 +305,7 @@ void showServer(BuildContext context) {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
child: Text('Cancel'), child: Text(translate('Cancel')),
), ),
FlatButton( FlatButton(
textColor: MyTheme.accent, textColor: MyTheme.accent,

View File

@ -368,7 +368,7 @@ class _RemotePageState extends State<RemotePage> {
color: active == true ? MyTheme.accent80 : null, color: active == true ? MyTheme.accent80 : null,
child: icon != null child: icon != null
? Icon(icon, size: 17, color: Colors.white) ? Icon(icon, size: 17, color: Colors.white)
: Text(text, : Text(translate(text),
style: TextStyle(color: Colors.white, fontSize: 11)), style: TextStyle(color: Colors.white, fontSize: 11)),
onPressed: onPressed)); onPressed: onPressed));
}; };
@ -579,7 +579,7 @@ void enterPasswordDialog(String id, BuildContext context) {
showAlertDialog( showAlertDialog(
context, context,
(setState) => Tuple3( (setState) => Tuple3(
Text(translate('Password required')), Text(translate('Password Required')),
Column(mainAxisSize: MainAxisSize.min, children: [ Column(mainAxisSize: MainAxisSize.min, children: [
PasswordWidget(controller: controller), PasswordWidget(controller: controller),
CheckboxListTile( CheckboxListTile(
@ -780,7 +780,7 @@ void showActions(BuildContext context) {
more.add(PopupMenuItem<String>( more.add(PopupMenuItem<String>(
child: Row( child: Row(
children: ([ children: ([
Text('OS Password'), Text(translate('OS Password')),
FlatButton( FlatButton(
textColor: MyTheme.accent, textColor: MyTheme.accent,
onPressed: () { onPressed: () {
@ -845,7 +845,7 @@ void showSetOSPassword(BuildContext context) async {
showAlertDialog( showAlertDialog(
context, context,
(setState) => Tuple3( (setState) => Tuple3(
Text(translate('Password required')), Text(translate('Password Required')),
Column(mainAxisSize: MainAxisSize.min, children: [ Column(mainAxisSize: MainAxisSize.min, children: [
PasswordWidget(controller: controller), PasswordWidget(controller: controller),
]), ]),