添加部分国际化

This commit is contained in:
魏少阳 2024-04-17 10:27:51 +08:00
parent 44f11670d9
commit 726a11a198
14 changed files with 99 additions and 133 deletions

View File

@ -687,6 +687,15 @@
"锁用户": "Lock user",
"请选择常开日期": "Please select the open date",
"结束时间不能小于开始时间哦": "The end time cannot be less than the start time",
"介绍": "Introduction",
"个人信息收集清单": "Personal information collection list",
"应用权限说明": "Application permission description",
"第三方信息共享清单": "Third party information sharing list",
"请选择您的位置": "Please select your location",
"请先选择位置": "Please select the location first",
"管理员密码": "Administrator password",
"如需修改,请输入新的管理员密码(6位),点击确定即可修改": "If you need to modify, please enter a new administrator password (6 digits), click OK to modify",
"修改": "Modify",
"相机": "camera",
"相册": "photos",

View File

@ -686,6 +686,15 @@
"锁用户": "锁用户",
"请选择常开日期": "请选择常开日期",
"结束时间不能小于开始时间哦": "结束时间不能小于开始时间哦",
"介绍": "介绍",
"个人信息收集清单": "个人信息收集清单",
"应用权限说明": "应用权限说明",
"第三方信息共享清单": "第三方信息共享清单",
"请选择您的位置": "请选择您的位置",
"请先选择位置": "请先选择位置",
"管理员密码": "管理员密码",
"如需修改,请输入新的管理员密码(6位),点击确定即可修改": "如需修改,请输入新的管理员密码(6位),点击确定即可修改",
"修改": "修改",
"相机": "相机",
"相册": "相册",

View File

@ -688,6 +688,15 @@
"锁用户": "锁用户",
"请选择常开日期": "请选择常开日期",
"结束时间不能小于开始时间哦": "结束时间不能小于开始时间哦",
"介绍": "介绍",
"个人信息收集清单": "个人信息收集清单",
"应用权限说明": "应用权限说明",
"第三方信息共享清单": "第三方信息共享清单",
"请选择您的位置": "请选择您的位置",
"请先选择位置": "请先选择位置",
"管理员密码": "管理员密码",
"如需修改,请输入新的管理员密码(6位),点击确定即可修改": "如需修改,请输入新的管理员密码(6位),点击确定即可修改",
"修改": "修改",
"相机": "相机",
"相册": "相册",

View File

@ -1,9 +1,8 @@
import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import '../../../../blue/blue_manage.dart';
import '../../../../blue/io_protocol/io_setSupportFunctionsNoParameters.dart';
@ -32,7 +31,7 @@ class OpenDoorDirectionLogic extends BaseGetXController {
// state.openDirectionValue.value = state.openDirectionValue.value == 1 ? 0 : 1;
state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue = state.openDirectionValue.value;
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
showToast("操作成功");
showToast("操作成功".tr);
}
}
@ -84,29 +83,25 @@ class OpenDoorDirectionLogic extends BaseGetXController {
int status = reply.data[2];
switch(status){
case 0x00:
//
print("${reply.commandType}数据解析成功");
//
Get.log("${reply.commandType}数据解析成功");
_setLockSetGeneralSetting();
break;
case 0x06:
//
print("${reply.commandType}需要鉴权");
//
Get.log("${reply.commandType}需要鉴权");
break;
case 0x07:
//
print("${reply.commandType}用户无权限");
//
Get.log("${reply.commandType}用户无权限");
break;
case 0x09:
//
print("${reply.commandType}权限校验错误");
//
Get.log("${reply.commandType}权限校验错误");
break;
default:
//
print("${reply.commandType}失败");
//
Get.log("${reply.commandType}失败");
break;
}
}
@ -146,7 +141,6 @@ class OpenDoorDirectionLogic extends BaseGetXController {
void onReady() {
// TODO: implement onReady
super.onReady();
print("onReady()");
_initReplySubscription();
}
@ -155,7 +149,6 @@ class OpenDoorDirectionLogic extends BaseGetXController {
void onInit() {
// TODO: implement onInit
super.onInit();
print("onInit()");
// _readSupportFunctionsNoParameters();
}

View File

@ -69,28 +69,24 @@ class _OpenDoorDirectionPageState extends State<OpenDoorDirectionPage> {
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
// SizedBox(width: 60.w,),
Container(
child: Row(
children: [
Obx(() => _colorfulCheckBox(1)),
Text(
TranslationLoader.lanKeys!.openLeft!.tr,
style: TextStyle(fontSize: 24.sp),
),
],
)
Row(
children: [
Obx(() => _colorfulCheckBox(1)),
Text(
TranslationLoader.lanKeys!.openLeft!.tr,
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),
),
],
)
Row(
children: [
Obx(() => _colorfulCheckBox(2)),
Text(
TranslationLoader.lanKeys!.openRight!.tr,
style: TextStyle(fontSize: 24.sp),
),
],
),
],
);
@ -100,10 +96,8 @@ class _OpenDoorDirectionPageState extends State<OpenDoorDirectionPage> {
return Radio(
value: selectIndex,
onChanged: (value) {
print("selectIndex$selectIndex valuevaluevaluevalue:$value");
// _selectGroupValue = value;
state.openDirectionValue.value = value;
print("state.openDirectionValue.value:${state.openDirectionValue.value}");
logic.sendOpenDoorDirection();
},
groupValue: state.openDirectionValue.value,

View File

@ -2,6 +2,7 @@ import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/talk/udp/udp_manage.dart';
import 'package:star_lock/tools/baseGetXController.dart';
@ -24,13 +25,11 @@ class RemoteUnlockingLogic extends BaseGetXController {
lockId: state.lockSetInfoData.value.lockId!,
remoteUnlock: state.remoteEnable.value == 1 ? 0 : 1);
if (entity.errorCode!.codeIsSuccessful) {
showToast("操作成功", something: () {
showToast("操作成功".tr, something: () {
eventBus.fire(RefreshLockListInfoDataEvent());
state.remoteEnable.value = state.remoteEnable.value == 1 ? 0 : 1;
state.lockSetInfoData.value.lockSettingInfo!.remoteUnlock =
state.remoteEnable.value;
print(
"state.remoteEnable.value:${state.remoteEnable.value} state.getKeyInfosData.value.remoteEnable:${state.lockSetInfoData.value.lockSettingInfo!.remoteUnlock}");
eventBus
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
eventBus.fire(RefreshLockListInfoDataEvent());
@ -93,7 +92,7 @@ class RemoteUnlockingLogic extends BaseGetXController {
switch (status) {
case 0x00:
//
print("${reply.commandType}数据解析成功");
Get.log("${reply.commandType}数据解析成功");
state.sureBtnState.value = 0;
cancelBlueConnetctToastTimer();
dismissEasyLoading();
@ -101,23 +100,19 @@ class RemoteUnlockingLogic extends BaseGetXController {
break;
case 0x06:
//
print("${reply.commandType}需要鉴权");
Get.log("${reply.commandType}需要鉴权");
break;
case 0x07:
//
print("${reply.commandType}用户无权限");
Get.log("${reply.commandType}用户无权限");
break;
case 0x09:
//
print("${reply.commandType}权限校验错误");
Get.log("${reply.commandType}权限校验错误");
break;
default:
//
print("${reply.commandType}失败");
Get.log("${reply.commandType}失败");
break;
}
}
@ -170,7 +165,6 @@ class RemoteUnlockingLogic extends BaseGetXController {
void onReady() {
// TODO: implement onReady
super.onReady();
print("onReady()");
_initReplySubscription();
}
@ -179,7 +173,6 @@ class RemoteUnlockingLogic extends BaseGetXController {
void onInit() {
// TODO: implement onInit
super.onInit();
print("onInit()");
// _readSupportFunctionsNoParameters();
}

View File

@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -72,8 +73,7 @@ class _RemoteUnlockingPageState extends State<RemoteUnlockingPage>
: TranslationLoader.lanKeys!.open!.tr,
onClick: () {
//
bool isContains =
BlueManage().connectDeviceName.contains("T9A");
bool isContains = BlueManage().connectDeviceName.contains("T9A");
if (isContains) {
logic.remoteUnlockingOpenOrClose();
} else {
@ -90,23 +90,22 @@ class _RemoteUnlockingPageState extends State<RemoteUnlockingPage>
// TODO: implement didChangeDependencies
super.didChangeDependencies();
///
//
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
}
@override
void dispose() {
// TODO: implement dispose
///
//
AppRouteObserver().routeObserver.unsubscribe(this);
super.dispose();
}
///
///
@override
void didPush() {
super.didPush();
print("lockSet===didPush");
state.ifCurrentScreen.value = true;
}
@ -114,7 +113,6 @@ class _RemoteUnlockingPageState extends State<RemoteUnlockingPage>
@override
void didPop() {
super.didPop();
print("lockSet===didPop");
logic.cancelBlueConnetctToastTimer();
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
BlueManage().stopScan();
@ -126,7 +124,6 @@ class _RemoteUnlockingPageState extends State<RemoteUnlockingPage>
@override
void didPopNext() {
super.didPopNext();
print("lockSet===didPopNext");
state.ifCurrentScreen.value = true;
}
@ -134,7 +131,7 @@ class _RemoteUnlockingPageState extends State<RemoteUnlockingPage>
@override
void didPushNext() {
super.didPushNext();
print("lockSet===didPushNext");
logic.cancelBlueConnetctToastTimer();
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
BlueManage().stopScan();

View File

@ -3,6 +3,7 @@ import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/resetButton/resetButton_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
@ -27,11 +28,11 @@ class ResetButtonLogic extends BaseGetXController{
);
if(entity.errorCode!.codeIsSuccessful){
// eventBus.fire(RefreshLockListInfoDataEvent());
state.resetButtonEnable.value = state.resetButtonEnable.value == 1 ? 2 : 1;
state.lockSetInfoData.value.lockSettingInfo!.resetSwitch = state.resetButtonEnable.value;
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
showToast("操作成功");
showToast("操作成功".tr, something: (){
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
});
}
}
@ -83,32 +84,28 @@ class ResetButtonLogic extends BaseGetXController{
int status = reply.data[2];
switch(status){
case 0x00:
//
print("${reply.commandType}数据解析成功");
//
Get.log("${reply.commandType}数据解析成功");
state.sureBtnState.value = 0;
cancelBlueConnetctToastTimer();
dismissEasyLoading();
_setLockSetGeneralSetting();
break;
case 0x06:
//
print("${reply.commandType}需要鉴权");
//
Get.log("${reply.commandType}需要鉴权");
break;
case 0x07:
//
print("${reply.commandType}用户无权限");
//
Get.log("${reply.commandType}用户无权限");
break;
case 0x09:
//
print("${reply.commandType}权限校验错误");
//
Get.log("${reply.commandType}权限校验错误");
break;
default:
//
print("${reply.commandType}失败");
//
Get.log("${reply.commandType}失败");
break;
}
}
@ -160,7 +157,6 @@ class ResetButtonLogic extends BaseGetXController{
void onReady() {
// TODO: implement onReady
super.onReady();
print("onReady()");
_initReplySubscription();
}
@ -169,7 +165,6 @@ class ResetButtonLogic extends BaseGetXController{
void onInit() {
// TODO: implement onInit
super.onInit();
print("onInit()");
// _readSupportFunctionsNoParameters();
}

View File

@ -7,6 +7,7 @@ import 'package:get/get.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../blue/blue_manage.dart';
import '../../../../tools/appRouteObserver.dart';
import '../../../../tools/showTipView.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
@ -82,7 +83,10 @@ class _ResetButtonPageState extends State<ResetButtonPage> with RouteAware {
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
onClick: () {
showDeletAlertTipDialog(context);
// showDeletAlertTipDialog(context);
ShowTipView().showIosTipWithContentDialog('确定要${state.resetButtonEnable.value == 1 ? TranslationLoader.lanKeys!.close!.tr : TranslationLoader.lanKeys!.open!.tr}重置键?', () {
logic.sendBurglarAlarm();
});
})),
],
),
@ -90,33 +94,6 @@ class _ResetButtonPageState extends State<ResetButtonPage> with RouteAware {
);
}
void showDeletAlertTipDialog(BuildContext context) {
showCupertinoDialog(
context: context,
builder: (context) {
return CupertinoAlertDialog(
title: const Text("提示"),
content: Text('确定要${state.resetButtonEnable.value == 1 ? TranslationLoader.lanKeys!.close!.tr : TranslationLoader.lanKeys!.open!.tr}重置键?'),
actions: [
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
onPressed: () {
Get.back();
},
),
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.sure!.tr),
onPressed: () {
Get.back();
logic.sendBurglarAlarm();
},
),
],
);
},
);
}
@override
void didChangeDependencies() {
// TODO: implement didChangeDependencies

View File

@ -38,7 +38,7 @@ class _AboutPageState extends State<AboutPage> {
packageName = packageInfo.packageName;
version = packageInfo.version;
buildNumber = packageInfo.buildNumber;
print("aboutGetversion:${version}");
Get.log("aboutGetversion:$version");
});
}
@ -60,7 +60,7 @@ class _AboutPageState extends State<AboutPage> {
]),
SizedBox(height: 20.h),
Text(
"${F.title} ${version}+${buildNumber}",
"${F.title} $version+$buildNumber",
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
),
SizedBox(height: 20.h),
@ -80,7 +80,7 @@ class _AboutPageState extends State<AboutPage> {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.introduceURL,
"title": '介绍'
"title": '介绍'.tr
});
}),
Divider(
@ -95,11 +95,10 @@ class _AboutPageState extends State<AboutPage> {
isHaveLine: false,
isHaveDirection: true,
action: () {
print("用户协议${XSConstantMacro.userAgreementURL}");
Navigator.pushNamed(context, Routers.webviewShowPage,
Get.toNamed(Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.userAgreementURL,
"title": '用户协议'
"title": '用户协议'.tr
});
}),
Divider(
@ -117,7 +116,7 @@ class _AboutPageState extends State<AboutPage> {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.privacyPolicyURL,
"title": '隐私政策'
"title": '隐私政策'.tr
});
}),
Divider(
@ -136,7 +135,7 @@ class _AboutPageState extends State<AboutPage> {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.collectionListURL,
"title": '个人信息收集清单'
"title": '个人信息收集清单'.tr
});
}),
Divider(
@ -155,7 +154,7 @@ class _AboutPageState extends State<AboutPage> {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.appPermissionDescURL,
"title": '应用权限说明'
"title": '应用权限说明'.tr
});
}),
Divider(
@ -174,7 +173,7 @@ class _AboutPageState extends State<AboutPage> {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.thirdPartyInfShareListURL,
"title": '第三方信息共享清单'
"title": '第三方信息共享清单'.tr
});
}),
],

View File

@ -111,7 +111,6 @@ class _AddLockPageState extends State<AddLockPage> with BaseWidget {
Permission.location,
].request();
print("statuses:$statuses");
//granted denied permanentlyDenied
if (statuses[Permission.bluetoothScan]!.isGranted &&
statuses[Permission.bluetoothConnect]!.isGranted &&

View File

@ -371,7 +371,6 @@ class NearbyLockLogic extends BaseGetXController {
void onReady() {
// TODO: implement onReady
super.onReady();
print("NearbyLockLogic onReady()");
_initReplySubscription();
// _scanListDiscoveredDeviceSubscriptionAction();
@ -384,7 +383,6 @@ class NearbyLockLogic extends BaseGetXController {
@override
void onInit() {
// TODO: implement onInit
print("NearbyLockLogic onInit()");
super.onInit();
}

View File

@ -38,7 +38,6 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
@override
Widget build(BuildContext context) {
print("NearbyLockLogic build()");
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
@ -150,8 +149,6 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
super.didPush();
Get.log("NearbyLockLogic didPush()");
// state.ifCurrentScreen.value = true;
// logic.startScanBlueList();
}
///

View File

@ -54,8 +54,6 @@ class SaveLockLogic extends BaseGetXController {
Storage.setStringList(saveBlueToken, strTokenList);
int status = reply.data[46];
Get.log("status:$status");
switch (status) {
case 0x00:
//
@ -314,7 +312,6 @@ class SaveLockLogic extends BaseGetXController {
var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!);
Get.log("openDoorTokenPubToken:$getTokenList");
IoSenderManage.changeAdministratorPasswordCommand(
keyID: "1",
@ -411,7 +408,7 @@ class SaveLockLogic extends BaseGetXController {
return ShowTFView(
title: "管理员密码",
tipTitle: "如需修改,请输入新的管理员密码(6位),点击确定即可修改",
leftBtnTitle: "确定",
leftBtnTitle: "确定".tr,
rightBtnTitle: "修改",
keyboardType: TextInputType.number,
inputFormatters: [
@ -421,12 +418,12 @@ class SaveLockLogic extends BaseGetXController {
controller: state.adminPasswordTF,
sureClick: () {
if(state.adminPasswordTF.text.length < 6){
showToast("请输入6位管理员密码");
showToast("请输入6位管理员密码".tr);
return;
}
if(state.adminPasswordTF.text == state.adminPassword){
showToast("请输入新的管理员密码");
showToast("请输入新的管理员密码".tr);
return;
}
changeAdministratorPasswordCommand();