From 7cc7e834b177b9d8aac54393c4bb1433013ad6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Tue, 28 Nov 2023 13:47:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=83=A8=E5=88=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/images/lan/lan_en.json | 53 ++++- star_lock/images/lan/lan_keys.json | 52 ++++- star_lock/images/lan/lan_zh.json | 51 ++++- star_lock/lib/blue/blue_manage.dart | 4 +- .../lcokSet/faceUnlock/faceUnlock_page.dart | 11 +- .../lcokSet/faceUnlock/faceUnlock_state.dart | 15 +- .../lcokSet/lockSet/lockSet_page.dart | 28 +-- .../lcokSet/motorPower/motorPower_page.dart | 52 ++--- .../openDoorDirection_page.dart | 48 +++-- .../lockDetail/lockDetail_page.dart | 14 +- .../groupEditLock/groupEditLock_page.dart | 2 +- .../lockItemList_page.dart | 4 +- .../lockGroupList/lockGroupList_page.dart | 20 +- .../mine/mineSet/mineSet/mineSet_page.dart | 3 +- star_lock/lib/tools/custom_bottom_sheet.dart | 5 +- star_lock/lib/tools/noData.dart | 5 +- star_lock/lib/translations/lanKeyEntity.dart | 191 +++++++++++++++++- 17 files changed, 457 insertions(+), 101 deletions(-) diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index 5bf5d871..d37b92df 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -234,7 +234,7 @@ "close":"Close", "open":"Open", "hideInvalidUnlockPermissions":"Hide Invalid Unlock Permissions", - "appUnlockRequiresMobilePhoneAccessToTheLock":"APP Unlock Requires Mobile Phone Access To The Lock", + "appUnlockRequiresMobilePhoneAccessToTheLock":"APP Unlock Requires Phone Access To Lock", "valueAddedServices":"Value Added Services", "about":"About", "userAgreement":"User Agreement", @@ -420,5 +420,54 @@ "getCard":"Get Card", "getFingerprint":"Get Fingerprint", "safeVerify":"Security verification", - "deleteAccountTips": "After deleting the account, all your information and related records will be completely deleted from the platform, and can not be recovered, delete or not" + "deleteAccountTips": "After deleting the account, all your information and related records will be completely deleted from the platform, and can not be recovered, delete or not", + + "humanFace":"Human Face", + "monitoring":"Monitoring", + "videoLog":"Video Log", + "messageReminding":"Message Reminding", + "superAdmin":"Super Admin", + "normalUser":"Normal User", + "gatewayDevice":"Gateway Device", + + "illumination":"Illumination", + "doorOpener":"Door Opener", + "faceUnlocks":"Face Unlocks", + "catEyeSet":"Cat Eye Set", + "openingDirectionSet":"Opening Direction Set", + "motorPowerSetting":"MotorPower Setting", + "bluetoothBroadcast":"Bluetooth Broadcast", + "whetherInternetRequiredWhenUnlocking":"If Internet Is Required When Unlocking", + + "selectTheLockToJoinTheGroup":"Select the lock to join the group", + "lockTrCount":"Lock Count", + "xiaomiIOTPlatform":"Xiaomi IOT Platform", + "connectBlueErrorTip":"Not connected to the device, make sure that in the vicinity of the device, the device is not connected and the device is turned on", + "pleaseEnterAGroupName": "Please enter a group name", + "hint": "Hint", + "areYouSureYouWantToDeleteIt": "Are you sure you want to delete it?", + + "faceUnlocksSet": "Face Unlocks Set", + "automaticBrighteningScreen": "Automatic brightening screen", + "sensingDistance": "Sensing distance", + "sensingDistanceTip": "When someone is sensed about 1.5 meters in front of the door, facial recognition will automatically start to unlock.", + "preventWrongOpening": "Prevent wrong opening", + "preventWrongOpeningTip": "Prevent misopening has been closed, after closing the door can still use face unlock", + "remote": "Remote", + "closeRange": "Close Range", + "addAndUseFaceWhenUnlocking": "Add and use face when unlocking", + "addAndUseFaceWhenUnlockingTip": "\n1, please try to keep a single person in front of the door operation; \n2, please stand in front of the door lock about 0.5~0.8 meters, facing the door lock; \n3. Please keep your face unobstructed and expose your facial features; \n4. When face recognition is abnormal, you can touch any key on the digital keyboard to restart face recognition manually.", + + "second": "S", + "motorPowerSettingTip": "Please choose the motor power carefully according to the actual situation of the door lock:", + "miniwatt": "miniwatt:", + "miniwattTip": "Less power consumption", + "highPower": "high-power:", + "highPowerTip": "If the lock tongue can not be retracted normally when unlocking, or need to be driven \nHeaven and earth hook, it is recommended to choose high power. At this point, the power consumption will be \nIncrease.", + + "openingDirectionSetTip": "Please carefully choose the direction to open the door of your home (if you choose the wrong direction, you will not be able to open and close the door properly) :", + "openLeft": "Open Left", + "openRight": "Open Right", + "judgmentMethod": "Judgment Method:\n", + "judgmentMethodContent": "The man stood outside the house, facing the entrance door. \nIf the hinge or shaft of the door is on the left, the door is left open; \nA door is right-open if its hinge or shaft is on the right. \nIf the setting is wrong, it will not open and close the door properly. \nRecommended to be operated by installation or maintenance personnel." } diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index f85db14a..4a2c1ba6 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -420,5 +420,55 @@ "getCard":"getCard", "getFingerprint":"getFingerprint", "safeVerify":"safeVerify", - "deleteAccountTips":"deleteAccountTips" + "deleteAccountTips":"deleteAccountTips", + + "humanFace":"humanFace", + "monitoring":"monitoring", + "videoLog":"videoLog", + "messageReminding":"messageReminding", + "superAdmin":"superAdmin", + "normalUser":"normalUser", + "gatewayDevice":"gatewayDevice", + + "illumination":"illumination", + "doorOpener":"doorOpener", + "faceUnlocks":"faceUnlocks", + "catEyeSet":"catEyeSet", + "openingDirectionSet":"openingDirectionSet", + "motorPowerSetting":"motorPowerSetting", + "bluetoothBroadcast":"bluetoothBroadcast", + "whetherInternetRequiredWhenUnlocking":"whetherInternetRequiredWhenUnlocking", + + "selectTheLockToJoinTheGroup":"selectTheLockToJoinTheGroup", + "lockTrCount":"lockTrCount", + "xiaomiIOTPlatform":"xiaomiIOTPlatform", + "connectBlueErrorTip":"connectBlueErrorTip", + "pleaseEnterAGroupName": "pleaseEnterAGroupName", + "hint": "hint", + "areYouSureYouWantToDeleteIt": "areYouSureYouWantToDeleteIt", + + "faceUnlocksSet": "faceUnlocksSet", + "automaticBrighteningScreen": "automaticBrighteningScreen", + "sensingDistance": "sensingDistance", + "sensingDistanceTip": "sensingDistanceTip", + "preventWrongOpening": "preventWrongOpening", + "preventWrongOpeningTip": "preventWrongOpeningTip", + "remote": "remote", + "closeRange": "closeRange", + "addAndUseFaceWhenUnlocking": "addAndUseFaceWhenUnlocking", + "addAndUseFaceWhenUnlockingTip":"addAndUseFaceWhenUnlockingTip", + + "second": "second", + "motorPowerSettingTip": "motorPowerSettingTip", + "miniwatt": "miniwatt", + "miniwattTip": "miniwattTip", + "highPower": "highPower", + "highPowerTip": "highPowerTip", + + "openingDirectionSetTip": "openingDirectionSetTip", + "openLeft": "openLeft", + "openRight": "openRight", + "judgmentMethod": "judgmentMethod", + "judgmentMethodContent": "judgmentMethodContent" + } \ No newline at end of file diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index 8a2b635f..6c41e023 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -423,5 +423,54 @@ "getCard":"获取卡", "getFingerprint":"获取指纹", "safeVerify":"安全验证", - "deleteAccountTips":"删除账号后,你的所有信息及相关记录都会从平台彻底删除,且不可恢复,是否删除?" + "deleteAccountTips":"删除账号后,你的所有信息及相关记录都会从平台彻底删除,且不可恢复,是否删除?", + + "humanFace":"人脸", + "monitoring":"监控", + "videoLog":"视频日志", + "messageReminding":"消息提醒", + "superAdmin":"超级管理员", + "normalUser":"普通用户", + "gatewayDevice":"网关设备", + + "illumination":"照明", + "doorOpener":"开门器", + "faceUnlocks":"面容开锁", + "catEyeSet":"猫眼设置", + "openingDirectionSet":"开门方向设置", + "motorPowerSetting":"电机功率设置", + "bluetoothBroadcast":"蓝牙广播", + "whetherInternetRequiredWhenUnlocking":"开锁时是否需联网", + + "selectTheLockToJoinTheGroup":"选择要加入分组的锁", + "lockTrCount":"锁数量", + "xiaomiIOTPlatform":"小米IOT平台", + "connectBlueErrorTip":"未连接到设备,请确保在设备附近,设备未被连接,设备已打开", + "pleaseEnterAGroupName": "请输入分组名称", + "hint": "提示", + "areYouSureYouWantToDeleteIt": "确定要删除吗?", + + "faceUnlocksSet": "面容开锁设置", + "automaticBrighteningScreen": "自动亮屏", + "sensingDistance": "感应距离", + "sensingDistanceTip": "感应到门前约1.5米有人时,将自动启动面部识别开锁。", + "preventWrongOpening": "防误开", + "preventWrongOpeningTip": "防误开已关闭,关门后仍可使用面容开锁", + "remote": "远距离", + "closeRange": "近距离", + "addAndUseFaceWhenUnlocking": "添加和使用面容开锁时", + "addAndUseFaceWhenUnlockingTip": "\n1、请尽量保持单人在门前操作;\n2、请站立在门锁正前方约0.5~0.8米,面向门锁;\n3、请保持脸部无遮挡,露出五官;\n4、面容识别异常时,可触摸数字键盘任意按键,手动重启人脸识别。", + + "second": "秒", + "motorPowerSettingTip": "请根据门锁实际情况,请谨慎选择电机功率:", + "miniwatt": "小功率:", + "miniwattTip": "耗电少", + "highPower": "大功率:", + "highPowerTip": "如果开锁时锁舌不能正常收回,,或需要带动\n天地钩,建议选择大功率。此时耗电将会\n增加。", + + "openingDirectionSetTip": "请谨慎选择您家的开门方向(如果选择错误,将无法正常开关门):", + "openLeft": "左开", + "openRight": "右开", + "judgmentMethod": "判断方法:\n", + "judgmentMethodContent": "人站在屋外,面向入户门。\n如果门的合页或门轴在左边,则门是左开;\n如果门的合页或门轴在右边,则门是右开。\n如果设置错误,将无法正常开关门。\n建议由安装或维修人员操作。" } \ No newline at end of file diff --git a/star_lock/lib/blue/blue_manage.dart b/star_lock/lib/blue/blue_manage.dart index 3a4fc21b..9e1e6d5f 100644 --- a/star_lock/lib/blue/blue_manage.dart +++ b/star_lock/lib/blue/blue_manage.dart @@ -3,9 +3,11 @@ import 'dart:async'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; +import 'package:get/get.dart'; import 'package:star_lock/blue/sender_manage.dart'; import '../tools/toast.dart'; +import '../translations/trans_lib.dart'; import 'io_tool/io_model.dart'; import 'io_tool/io_tool.dart'; import 'io_tool/manager_event_bus.dart'; @@ -222,7 +224,7 @@ class BlueManage{ // print("11111111$deviceConnectionState"); if(isShowToast){ if(deviceMAC.isEmpty){ - Toast.show(msg: "未连接到设备,请确保在设备附近,设备未被连接,设备已打开"); + Toast.show(msg: TranslationLoader.lanKeys!.connectBlueErrorTip!.tr); // return; } } diff --git a/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart b/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart index fa2e2934..dad35bde 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart @@ -8,6 +8,7 @@ import 'package:star_lock/tools/custom_bottom_sheet.dart'; import '../../../../app_settings/app_colors.dart'; import '../../../../tools/commonItem.dart'; import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; class FaceUnlockPage extends StatefulWidget { const FaceUnlockPage({Key? key}) : super(key: key); @@ -25,13 +26,13 @@ class _FaceUnlockPageState extends State { return Scaffold( backgroundColor: Colors.white, appBar: TitleAppBar( - barTitle: '面容开锁设置', + barTitle: TranslationLoader.lanKeys!.faceUnlocksSet!.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: Column( children: [ CommonItem( - leftTitel: '面容开锁', + leftTitel: TranslationLoader.lanKeys!.faceUnlocks!.tr, rightTitle: "", allHeight: 70.h, isHaveLine: true, @@ -39,14 +40,14 @@ class _FaceUnlockPageState extends State { rightWidget: SizedBox(width: 60.w, height: 50.h, child: _switch(1))), CommonItem( - leftTitel: '自动亮屏', + leftTitel: TranslationLoader.lanKeys!.automaticBrighteningScreen!.tr, rightTitle: "", isHaveLine: true, isHaveRightWidget: true, rightWidget: SizedBox(width: 60.w, height: 50.h, child: _switch(2))), _buildSubTitleItem( - '感应距离', '感应到门前约1.5米有人时,将自动启动面部识别开锁。', state.senseDistance.value, + TranslationLoader.lanKeys!.sensingDistance!.tr, TranslationLoader.lanKeys!.sensingDistanceTip!.tr, state.senseDistance.value, () { _openBottomItemSheet(state.senseDistanceList.value, 0); }), @@ -54,7 +55,7 @@ class _FaceUnlockPageState extends State { height: 30.h, ), _buildSubTitleItem( - '防误开', '防误开已关闭,关门后仍可使用面容开锁', state.antiMisoperation.value, () { + TranslationLoader.lanKeys!.preventWrongOpening!.tr, TranslationLoader.lanKeys!.preventWrongOpeningTip!.tr, state.antiMisoperation.value, () { _openBottomItemSheet(state.antiMisoperationList.value, 1); }), Expanded( diff --git a/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_state.dart b/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_state.dart index 35cf61ae..4b17e17f 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_state.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_state.dart @@ -5,14 +5,16 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/app_settings/app_colors.dart'; +import '../../../../translations/trans_lib.dart'; + class FaceUnlockState { var isCheck = false.obs; var faceOn = false.obs; //面容开锁 var autoBright = false.obs; //自动亮屏 - var senseDistance = '远距离'.obs; //感应距离 - var antiMisoperation = '关闭'.obs; //防误开 - var senseDistanceList = ['远距离', '近距离'].obs; - var antiMisoperationList = ['关闭', '5秒', '10秒', '15秒', '30秒', '60秒'].obs; + var senseDistance = TranslationLoader.lanKeys!.remote!.tr.obs; //感应距离 + var antiMisoperation = TranslationLoader.lanKeys!.close!.tr.obs; //防误开 + var senseDistanceList = [TranslationLoader.lanKeys!.remote!.tr, TranslationLoader.lanKeys!.closeRange!.tr].obs; + var antiMisoperationList = [TranslationLoader.lanKeys!.close!.tr, '5${TranslationLoader.lanKeys!.second!.tr}', '10${TranslationLoader.lanKeys!.second!.tr}', '15${TranslationLoader.lanKeys!.second!.tr}', '30${TranslationLoader.lanKeys!.second!.tr}', '60${TranslationLoader.lanKeys!.second!.tr}'].obs; //高亮样式 final TextStyle titleStyle = TextStyle( color: Colors.black, fontSize: 24.sp, fontWeight: FontWeight.w500); @@ -21,10 +23,9 @@ class FaceUnlockState { TextStyle(color: AppColors.placeholderTextColor, fontSize: 22.sp); late InlineSpan tipsPreviewSpan = TextSpan(children: [ - TextSpan(text: '添加和使用面容开锁时:\n', style: titleStyle), + TextSpan(text: '${TranslationLoader.lanKeys!.addAndUseFaceWhenUnlocking!.tr}:\n', style: titleStyle), TextSpan( - text: - '\n1、请尽量保持单人在门前操作;\n2、请站立在门锁正前方约0.5~0.8米,面向门锁;\n3、请保持脸部无遮挡,露出五官;\n4、面容识别异常时,可触摸数字键盘任意按键,手动重启人脸识别。', + text:TranslationLoader.lanKeys!.addAndUseFaceWhenUnlockingTip!.tr, style: subTipsStyle), ]); } diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart index 5bc6bac0..92e77479 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart @@ -99,7 +99,7 @@ class _LockSetPageState extends State with RouteAware { ? true : false, child: CommonItem( - leftTitel: '照明', + leftTitel: TranslationLoader.lanKeys!.illumination!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, @@ -110,7 +110,7 @@ class _LockSetPageState extends State with RouteAware { Visibility( visible: true, child: CommonItem( - leftTitel: '开门器', + leftTitel: TranslationLoader.lanKeys!.doorOpener!.tr, rightTitle: "", isHaveLine: false, isHaveDirection: true, @@ -125,9 +125,7 @@ class _LockSetPageState extends State with RouteAware { child: CommonItem( leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr, - rightTitle: (state.lockSettingInfo.value.autoLock ?? - 0) > - 0 + rightTitle: (state.lockSettingInfo.value.autoLock ?? 0) > 0 ? "${state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond ?? 0}s" : TranslationLoader.lanKeys!.closed!.tr, isHaveLine: true, @@ -191,9 +189,7 @@ class _LockSetPageState extends State with RouteAware { leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr, rightTitle: - (state.lockSettingInfo.value.antiPrySwitch ?? - 0) == - 1 + (state.lockSettingInfo.value.antiPrySwitch ?? 0) == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr, isHaveLine: true, @@ -272,7 +268,7 @@ class _LockSetPageState extends State with RouteAware { Visibility( visible: true, child: CommonItem( - leftTitel: '面容开锁', + leftTitel: TranslationLoader.lanKeys!.faceUnlocks!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, @@ -283,7 +279,7 @@ class _LockSetPageState extends State with RouteAware { Visibility( visible: true, child: CommonItem( - leftTitel: '消息提醒', + leftTitel: TranslationLoader.lanKeys!.messageReminding!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, @@ -293,7 +289,7 @@ class _LockSetPageState extends State with RouteAware { Visibility( visible: true, child: CommonItem( - leftTitel: '猫眼设置', + leftTitel: TranslationLoader.lanKeys!.catEyeSet!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, @@ -329,7 +325,7 @@ class _LockSetPageState extends State with RouteAware { Visibility( visible: true, child: CommonItem( - leftTitel: '开门方向设置', + leftTitel: TranslationLoader.lanKeys!.openingDirectionSet!.tr, rightTitle: "", isHaveDirection: true, isHaveLine: true, @@ -339,12 +335,10 @@ class _LockSetPageState extends State with RouteAware { 'lockSetInfoData': state.lockSetInfoData.value }); })), - // ), - // Obx(() => Visibility( visible: true, child: CommonItem( - leftTitel: '电机功率设置', + leftTitel: TranslationLoader.lanKeys!.motorPowerSetting!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, @@ -356,7 +350,7 @@ class _LockSetPageState extends State with RouteAware { Obx(() => Visibility( visible: true, child: CommonItem( - leftTitel: '蓝牙广播', + leftTitel: TranslationLoader.lanKeys!.bluetoothBroadcast!.tr, rightTitle: "", isHaveLine: true, isHaveRightWidget: true, @@ -420,7 +414,7 @@ class _LockSetPageState extends State with RouteAware { visible: state.lockFeature.value.appUnlockOnline == 1 ? true : false, child: CommonItem( - leftTitel: "开锁时是否需联网", + leftTitel: TranslationLoader.lanKeys!.whetherInternetRequiredWhenUnlocking!.tr, rightTitle: "", isHaveLine: false, isHaveRightWidget: true, diff --git a/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_page.dart b/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_page.dart index 9981753a..657741c0 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_page.dart @@ -1,8 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import '../../../../app_settings/app_colors.dart'; import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; class MotorPowerPage extends StatefulWidget { const MotorPowerPage({Key? key}) : super(key: key); @@ -19,7 +21,7 @@ class _MotorPowerPageState extends State { return Scaffold( backgroundColor: Colors.white, appBar: TitleAppBar( - barTitle: '电机功率设置', + barTitle: TranslationLoader.lanKeys!.motorPowerSetting!.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: Column( @@ -31,7 +33,7 @@ class _MotorPowerPageState extends State { margin: EdgeInsets.only(left: 40.w), alignment: Alignment.centerLeft, child: Text( - '请根据门锁实际情况,请谨慎选择电机功率:', + TranslationLoader.lanKeys!.motorPowerSettingTip!.tr, style: TextStyle( fontSize: 24.sp, color: Colors.black, @@ -41,12 +43,12 @@ class _MotorPowerPageState extends State { SizedBox( height: 40.h, ), - _buildTipsView('小功率:\n', '耗电少', isCheck), + _buildTipsView('${TranslationLoader.lanKeys!.miniwatt!.tr}\n', TranslationLoader.lanKeys!.miniwattTip!.tr, isCheck), SizedBox( height: 20.h, ), - _buildTipsView('大功率:\n', - '如果开锁时锁舌不能正常收回,或需要带动\n天地钩,建议选择大功率。此时耗电将会\n增加。', !isCheck) + _buildTipsView('${TranslationLoader.lanKeys!.highPower!.tr}\n', + TranslationLoader.lanKeys!.highPowerTip!.tr, !isCheck) ], )); } @@ -56,31 +58,33 @@ class _MotorPowerPageState extends State { child: Container( width: ScreenUtil().screenWidth - 40.w, margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h), + padding: EdgeInsets.only( + left: 20.w, top: 30.h, bottom: 30.h, right: 15.w), decoration: BoxDecoration( color: isClick ? AppColors.blueViewBgColor : AppColors.greyBackgroundColor, borderRadius: BorderRadius.circular(10.0), ), - child: Padding( - padding: EdgeInsets.only( - left: 20.w, top: 30.h, bottom: 30.h, right: 15.w), - child: Row( - children: [ - isClick - ? Image.asset( - 'images/mine/icon_mine_blueSelect.png', - width: 20.w, - height: 14.w, - ) - : SizedBox( - width: 20.w, - height: 14.w, - ), - SizedBox(width: 20.w), - _buildRichText(titleStr, subTitle, isClick), - ], - )), + child: Row( + children: [ + isClick + ? Image.asset( + 'images/mine/icon_mine_blueSelect.png', + width: 20.w, + height: 14.w, + ) + : SizedBox( + width: 20.w, + height: 14.w, + ), + SizedBox(width: 20.w), + SizedBox( + width: ScreenUtil().screenWidth - 40.w - 20.w*4, + child: _buildRichText(titleStr, subTitle, isClick) + ), + ], + ), ), onTap: () { setState(() { diff --git a/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_page.dart b/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_page.dart index ee495770..9df49088 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_page.dart @@ -4,6 +4,7 @@ import 'package:get/get.dart'; import '../../../../app_settings/app_colors.dart'; import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; import 'openDoorDirection_logic.dart'; class OpenDoorDirectionPage extends StatefulWidget { @@ -26,7 +27,7 @@ class _OpenDoorDirectionPageState extends State { return Scaffold( backgroundColor: Colors.white, appBar: TitleAppBar( - barTitle: '开门方向设置', + barTitle: TranslationLoader.lanKeys!.openingDirectionSet!.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: Column( @@ -35,10 +36,10 @@ class _OpenDoorDirectionPageState extends State { height: 60.h, ), Container( - margin: EdgeInsets.only(left: 40.w), + margin: EdgeInsets.only(left: 40.w, right: 40.w), alignment: Alignment.centerLeft, child: Text( - '请谨慎选择您家的开门方向(如果选择错误,将无法正常开关门):', + TranslationLoader.lanKeys!.openingDirectionSetTip!.tr, style: TextStyle( fontSize: 24.sp, color: Colors.black, @@ -55,8 +56,8 @@ class _OpenDoorDirectionPageState extends State { height: 60.h, ), _buildTipsView( - '判断方法:\n', - '人站在屋外,面向入户门。\n如果门的合页或门轴在左边,则门是左开;\n如果门的合页或门轴在右边,则门是右开。\n如果设置错误,将无法正常开关门。\n建议由安装或维修人员操作。', + TranslationLoader.lanKeys!.judgmentMethod!.tr, + TranslationLoader.lanKeys!.judgmentMethodContent!.tr, false) ], )); @@ -65,22 +66,31 @@ class _OpenDoorDirectionPageState extends State { //单选框选择 Row _buildRadioGroupRowWidget() { return Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - SizedBox( - width: 60.w, + // SizedBox(width: 60.w,), + Container( + child: Row( + children: [ + Obx(() => _colorfulCheckBox(1)), + Text( + TranslationLoader.lanKeys!.openLeft!.tr, + style: TextStyle(fontSize: 24.sp), + ), + ], + ) ), - Obx(() => _colorfulCheckBox(1)), - Text( - "左开", - style: TextStyle(fontSize: 24.sp), - ), - SizedBox( - width: 200.w, - ), - Obx(() => _colorfulCheckBox(2)), - Text( - '右开', - style: TextStyle(fontSize: 24.sp), + // SizedBox(width: 100.w), + Container( + child: Row( + children: [ + Obx(() => _colorfulCheckBox(2)), + Text( + TranslationLoader.lanKeys!.openRight!.tr, + style: TextStyle(fontSize: 24.sp), + ), + ], + ) ), ], ); diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 85dda4e1..9b9eea49 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -196,8 +196,8 @@ class _LockDetailPageState extends State ), Text( state.keyInfos.value.isLockOwner == 1 - ? '超级管理员' - : (state.keyInfos.value.keyRight == 1 ? "授权管理员" : "普通用户"), + ? TranslationLoader.lanKeys!.superAdmin!.tr + : (state.keyInfos.value.keyRight == 1 ? TranslationLoader.lanKeys!.authorizedAdmin!.tr: TranslationLoader.lanKeys!.normalUser!.tr), style: TextStyle( fontSize: 20.sp, color: AppColors.darkGrayTextColor), ), @@ -218,7 +218,7 @@ class _LockDetailPageState extends State width: 6.w, ), Text( - '网关设备', + TranslationLoader.lanKeys!.gatewayDevice!.tr, style: TextStyle( fontSize: 20.sp, color: state.keyInfos.value.remoteEnable == 1 @@ -333,7 +333,7 @@ class _LockDetailPageState extends State //可视对讲门锁新增->人脸 if (state.keyInfos.value.lockFeature!.d3Face == 1) { showWidgetArr.add( - bottomItem('images/main/icon_face.png', '人脸', () { + bottomItem('images/main/icon_face.png', TranslationLoader.lanKeys!.humanFace!.tr, () { Get.toNamed(Routers.otherTypeKeyListPage, arguments: { "lockId": widget.lockListInfoItemEntity.lockId, "fromType": 3 @@ -350,7 +350,7 @@ class _LockDetailPageState extends State //可视对讲门锁新增->监控 if (state.keyInfos.value.lockFeature!.videoIntercom == 1) { showWidgetArr.add( - bottomItem('images/main/icon_catEyes.png', '监控', () { + bottomItem('images/main/icon_catEyes.png', TranslationLoader.lanKeys!.monitoring!.tr, () { // Navigator.pushNamed(context, Routers.otherTypeKeyListPage, // arguments: 1); // Toast.show(msg: "功能暂未开放"); @@ -375,12 +375,12 @@ class _LockDetailPageState extends State arguments: {"keyInfo": widget.lockListInfoItemEntity}); }), // 视频日志 - bottomItem('images/main/icon_lockDetail_videoLog.png', "视频日志", () { + bottomItem('images/main/icon_lockDetail_videoLog.png', TranslationLoader.lanKeys!.videoLog!.tr, () { //视频日志 Get.toNamed(Routers.videoLogPage); }), // 消息提醒 - bottomItem('images/main/icon_lockDetail_messageReminding.png', "消息提醒", () { + bottomItem('images/main/icon_lockDetail_messageReminding.png', TranslationLoader.lanKeys!.messageReminding!.tr, () { Get.toNamed(Routers.msgNotificationPage); }), // 设置 diff --git a/star_lock/lib/mine/mineSet/lockGroup/groupEditLock/groupEditLock_page.dart b/star_lock/lib/mine/mineSet/lockGroup/groupEditLock/groupEditLock_page.dart index 3e923b6c..cc1bd86c 100644 --- a/star_lock/lib/mine/mineSet/lockGroup/groupEditLock/groupEditLock_page.dart +++ b/star_lock/lib/mine/mineSet/lockGroup/groupEditLock/groupEditLock_page.dart @@ -35,7 +35,7 @@ class _GroupEditLockPageState extends State { margin: EdgeInsets.all(15.w), child: Row( children: [ - Text("选择要加入分组的锁", style: TextStyle(fontSize: 25.sp)), + Text(TranslationLoader.lanKeys!.selectTheLockToJoinTheGroup!.tr, style: TextStyle(fontSize: 25.sp)), ], ), ), diff --git a/star_lock/lib/mine/mineSet/lockGroup/lockGroupDetailList/lockItemList_page.dart b/star_lock/lib/mine/mineSet/lockGroup/lockGroupDetailList/lockItemList_page.dart index 67f5847f..59697de9 100644 --- a/star_lock/lib/mine/mineSet/lockGroup/lockGroupDetailList/lockItemList_page.dart +++ b/star_lock/lib/mine/mineSet/lockGroup/lockGroupDetailList/lockItemList_page.dart @@ -86,7 +86,7 @@ class _LockItemListPageState extends State { left: (ScreenUtil().screenWidth - 200.w) / 2, width: 200.w, child: SubmitBtn( - btnName: '添加', + btnName: TranslationLoader.lanKeys!.add!.tr, onClick: () { //选择要添加到分组的锁 Get.toNamed(Routers.groupEditLockPage, arguments: {'groupListItem': groupListItem, 'ungrouped': ungrouped, 'type': 0}); @@ -137,7 +137,7 @@ class _LockItemListPageState extends State { builder: (BuildContext context) { return AlertBottomWidget( topTitle: '', - items: const ['添加', '删除'], + items: [TranslationLoader.lanKeys!.add!.tr, TranslationLoader.lanKeys!.delete!.tr], chooseCallback: (value) { int getSelectIndex = value; if (getSelectIndex == 0) { diff --git a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart index 6c85b8ec..826b4709 100644 --- a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart +++ b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart @@ -73,7 +73,7 @@ class _LockGroupListPageState extends State { SizedBox( height: 40.h, child: Text( - '锁数量:${state.lockNum.toString()}', + '${TranslationLoader.lanKeys!.lockTrCount!.tr}:${state.lockNum.toString()}', style: TextStyle( color: AppColors.darkGrayTextColor, fontSize: 20.sp), ), @@ -137,7 +137,7 @@ class _LockGroupListPageState extends State { } Navigator.pop(context); } else { - Toast.show(msg: '请输入分组名称'); + Toast.show(msg: TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr); } }, cancelClick: () { @@ -158,9 +158,9 @@ class _LockGroupListPageState extends State { width: 100.w, color: const Color(0xFFF20101), alignment: Alignment.center, - child: const Text( - '删除', - style: TextStyle( + child: Text( + TranslationLoader.lanKeys!.delete!.tr, + style: const TextStyle( fontSize: 16, fontWeight: FontWeight.w500, color: Colors.white, @@ -182,9 +182,9 @@ class _LockGroupListPageState extends State { width: 100.w, color: AppColors.mainColor, alignment: Alignment.center, - child: const Text( - '编辑', - style: TextStyle( + child: Text( + TranslationLoader.lanKeys!.edit!.tr, + style: const TextStyle( fontSize: 16, fontWeight: FontWeight.w500, color: Colors.white, @@ -200,8 +200,8 @@ class _LockGroupListPageState extends State { context: context, builder: (BuildContext context) { return ShowIosTipView( - title: "提示", - tipTitle: "确定要删除吗?", + title: TranslationLoader.lanKeys!.hint!.tr, + tipTitle: TranslationLoader.lanKeys!.areYouSureYouWantToDeleteIt!.tr, sureClick: () { Get.back(); logic.deleteLockGroupRequest(groupListItem.keyGroupId!); diff --git a/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart b/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart index 98c9151a..a3dbad25 100644 --- a/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart +++ b/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart @@ -199,7 +199,8 @@ class _MineSetPageState extends State { Toast.show(msg: "功能暂未开放"); }), CommonItem( - leftTitel: "小米IoT平台", + leftTitel: TranslationLoader + .lanKeys!.xiaomiIOTPlatform!.tr, rightTitle: "", isHaveLine: false, isHaveDirection: true, diff --git a/star_lock/lib/tools/custom_bottom_sheet.dart b/star_lock/lib/tools/custom_bottom_sheet.dart index ea76d2f9..a0b47a2b 100644 --- a/star_lock/lib/tools/custom_bottom_sheet.dart +++ b/star_lock/lib/tools/custom_bottom_sheet.dart @@ -1,7 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:star_lock/app_settings/app_colors.dart'; +import '../translations/trans_lib.dart'; + class AlertBottomWidget extends StatelessWidget { List items; ValueChanged chooseCallback; @@ -88,7 +91,7 @@ class AlertBottomWidget extends StatelessWidget { style: ButtonStyle( overlayColor: MaterialStateProperty.all(Colors.white)), child: Text( - '取消', + TranslationLoader.lanKeys!.cancel!.tr, style: TextStyle(color: Colors.black, fontSize: ScreenUtil().setSp(24)), ), diff --git a/star_lock/lib/tools/noData.dart b/star_lock/lib/tools/noData.dart index a856285f..fed8b5f4 100644 --- a/star_lock/lib/tools/noData.dart +++ b/star_lock/lib/tools/noData.dart @@ -1,7 +1,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:star_lock/app_settings/app_colors.dart'; +import '../translations/trans_lib.dart'; + class NoData extends StatelessWidget { const NoData({Key? key}) : super(key: key); @@ -22,7 +25,7 @@ class NoData extends StatelessWidget { height: 180.h, ), Text( - '暂无数据', + TranslationLoader.lanKeys!.noData!.tr, style: TextStyle(color: AppColors.darkGrayTextColor, fontSize: 22.sp), ) diff --git a/star_lock/lib/translations/lanKeyEntity.dart b/star_lock/lib/translations/lanKeyEntity.dart index a3431236..791768c9 100644 --- a/star_lock/lib/translations/lanKeyEntity.dart +++ b/star_lock/lib/translations/lanKeyEntity.dart @@ -405,7 +405,51 @@ class LanKeyEntity { this.getCard, this.getFingerprint, this.safeVerify, - this.deleteAccountTips}); + this.deleteAccountTips, + this.humanFace, + this.monitoring, + this.videoLog, + this.messageReminding, + this.superAdmin, + this.normalUser, + this.gatewayDevice, + this.illumination, + this.doorOpener, + this.faceUnlocks, + this.catEyeSet, + this.openingDirectionSet, + this.motorPowerSetting, + this.bluetoothBroadcast, + this.whetherInternetRequiredWhenUnlocking, + this.selectTheLockToJoinTheGroup, + this.lockTrCount, + this.xiaomiIOTPlatform, + this.connectBlueErrorTip, + this.pleaseEnterAGroupName, + this.hint, + this.areYouSureYouWantToDeleteIt, + this.faceUnlocksSet, + this.automaticBrighteningScreen, + this.sensingDistance, + this.sensingDistanceTip, + this.preventWrongOpening, + this.preventWrongOpeningTip, + this.remote, + this.closeRange, + this.addAndUseFaceWhenUnlocking, + this.addAndUseFaceWhenUnlockingTip, + this.second, + this.motorPowerSettingTip, + this.miniwatt, + this.miniwattTip, + this.highPower, + this.highPowerTip, + this.openingDirectionSetTip, + this.openLeft, + this.openRight, + this.judgmentMethod, + this.judgmentMethodContent, + }); LanKeyEntity.fromJson(dynamic json) { starLock = json['starLock']; @@ -843,6 +887,54 @@ class LanKeyEntity { getFingerprint = json['getFingerprint']; safeVerify = json['safeVerify']; deleteAccountTips = json['deleteAccountTips']; + + humanFace = json['humanFace']; + monitoring = json['monitoring']; + videoLog = json['videoLog']; + messageReminding = json['messageReminding']; + superAdmin = json['superAdmin']; + normalUser = json['normalUser']; + gatewayDevice = json['gatewayDevice']; + + illumination = json['illumination']; + doorOpener = json['doorOpener']; + faceUnlocks = json['faceUnlocks']; + catEyeSet = json['catEyeSet']; + openingDirectionSet = json['openingDirectionSet']; + motorPowerSetting = json['motorPowerSetting']; + bluetoothBroadcast = json['bluetoothBroadcast']; + whetherInternetRequiredWhenUnlocking = json['whetherInternetRequiredWhenUnlocking']; + selectTheLockToJoinTheGroup = json['selectTheLockToJoinTheGroup']; + lockTrCount = json['lockTrCount']; + xiaomiIOTPlatform = json['xiaomiIOTPlatform']; + connectBlueErrorTip = json['connectBlueErrorTip']; + pleaseEnterAGroupName = json['pleaseEnterAGroupName']; + hint = json['hint']; + areYouSureYouWantToDeleteIt = json['areYouSureYouWantToDeleteIt']; + + faceUnlocksSet = json['faceUnlocksSet']; + automaticBrighteningScreen = json['automaticBrighteningScreen']; + sensingDistance = json['sensingDistance']; + sensingDistanceTip = json['sensingDistanceTip']; + preventWrongOpening = json['preventWrongOpening']; + preventWrongOpeningTip = json['preventWrongOpeningTip']; + remote = json['remote']; + closeRange = json['closeRange']; + addAndUseFaceWhenUnlocking = json['addAndUseFaceWhenUnlocking']; + addAndUseFaceWhenUnlockingTip = json['addAndUseFaceWhenUnlockingTip']; + + second = json['second']; + motorPowerSettingTip = json['motorPowerSettingTip']; + miniwatt = json['miniwatt']; + miniwattTip = json['miniwattTip']; + highPower = json['highPower']; + highPowerTip = json['highPowerTip']; + + openingDirectionSetTip = json['openingDirectionSetTip']; + openLeft = json['openLeft']; + openRight = json['openRight']; + judgmentMethod = json['judgmentMethod']; + judgmentMethodContent = json['judgmentMethodContent']; } String? starLock; String? clickUnlockAndHoldDownClose; @@ -1268,6 +1360,54 @@ class LanKeyEntity { String? safeVerify; String? deleteAccountTips; + String? humanFace; + String? monitoring; + String? videoLog; + String? messageReminding; + String? superAdmin; + String? normalUser; + String? gatewayDevice; + + String? illumination; + String? doorOpener; + String? faceUnlocks; + String? catEyeSet; + String? openingDirectionSet; + String? motorPowerSetting; + String? bluetoothBroadcast; + String? whetherInternetRequiredWhenUnlocking; + String? selectTheLockToJoinTheGroup; + String? lockTrCount; + String? xiaomiIOTPlatform; + String? connectBlueErrorTip; + String? pleaseEnterAGroupName; + String? hint; + String? areYouSureYouWantToDeleteIt; + + String? faceUnlocksSet; + String? automaticBrighteningScreen; + String? sensingDistance; + String? sensingDistanceTip; + String? preventWrongOpening; + String? preventWrongOpeningTip; + String? remote; + String? closeRange; + String? addAndUseFaceWhenUnlocking; + String? addAndUseFaceWhenUnlockingTip; + + String? second; + String? motorPowerSettingTip; + String? miniwatt; + String? miniwattTip; + String? highPower; + String? highPowerTip; + + String? openingDirectionSetTip; + String? openLeft; + String? openRight; + String? judgmentMethod; + String? judgmentMethodContent; + Map toJson() { final map = {}; map['starLock'] = starLock; @@ -1702,6 +1842,55 @@ class LanKeyEntity { map['getFingerprint'] = getFingerprint; map['safeVerify'] = safeVerify; map['deleteAccountTips'] = deleteAccountTips; + + map['humanFace'] = humanFace; + map['monitoring'] = monitoring; + map['videoLog'] = videoLog; + map['messageReminding'] = messageReminding; + map['superAdmin'] = superAdmin; + map['normalUser'] = normalUser; + map['gatewayDevice'] = gatewayDevice; + + map['illumination'] = illumination; + map['doorOpener'] = doorOpener; + map['faceUnlocks'] = faceUnlocks; + map['catEyeSet'] = catEyeSet; + map['openingDirectionSet'] = openingDirectionSet; + map['motorPowerSetting'] = motorPowerSetting; + map['bluetoothBroadcast'] = bluetoothBroadcast; + map['whetherInternetRequiredWhenUnlocking'] = whetherInternetRequiredWhenUnlocking; + map['selectTheLockToJoinTheGroup'] = selectTheLockToJoinTheGroup; + map['lockTrCount'] = lockTrCount; + map['xiaomiIOTPlatform'] = xiaomiIOTPlatform; + map['connectBlueErrorTip'] = connectBlueErrorTip; + map['pleaseEnterAGroupName'] = pleaseEnterAGroupName; + map['hint'] = hint; + map['areYouSureYouWantToDeleteIt'] = areYouSureYouWantToDeleteIt; + + map['faceUnlocksSet'] = faceUnlocksSet; + map['automaticBrighteningScreen'] = automaticBrighteningScreen; + map['sensingDistance'] = sensingDistance; + map['sensingDistanceTip'] = sensingDistanceTip; + map['preventWrongOpening'] = preventWrongOpening; + map['preventWrongOpeningTip'] = preventWrongOpeningTip; + map['remote'] = remote; + map['closeRange'] = closeRange; + map['addAndUseFaceWhenUnlocking'] = addAndUseFaceWhenUnlocking; + map['addAndUseFaceWhenUnlockingTip'] = addAndUseFaceWhenUnlockingTip; + + map['second'] = second; + map['motorPowerSettingTip'] = motorPowerSettingTip; + map['miniwatt'] = miniwatt; + map['miniwattTip'] = miniwattTip; + map['highPower'] = highPower; + map['highPowerTip'] = highPowerTip; + + map['openingDirectionSetTip'] = openingDirectionSetTip; + map['openLeft'] = openLeft; + map['openRight'] = openRight; + map['judgmentMethod'] = judgmentMethod; + map['judgmentMethodContent'] = judgmentMethodContent; + return map; } }