添加部分国际化

This commit is contained in:
魏少阳 2024-04-16 18:33:24 +08:00
parent 4a6a4077af
commit d36f170889
7 changed files with 36 additions and 46 deletions

View File

@ -685,6 +685,8 @@
"近距离": "Short distance",
"锁时间更新成功": "Lock time update success",
"锁用户": "Lock user",
"请选择常开日期": "Please select the open date",
"结束时间不能小于开始时间哦": "The end time cannot be less than the start time",
"相机": "camera",
"相册": "photos",

View File

@ -684,6 +684,8 @@
"近距离": "近距离",
"锁时间更新成功": "锁时间更新成功",
"锁用户": "锁用户",
"请选择常开日期": "请选择常开日期",
"结束时间不能小于开始时间哦": "结束时间不能小于开始时间哦",
"相机": "相机",
"相册": "相册",

View File

@ -686,6 +686,8 @@
"近距离": "近距离",
"锁时间更新成功": "锁时间更新成功",
"锁用户": "锁用户",
"请选择常开日期": "请选择常开日期",
"结束时间不能小于开始时间哦": "结束时间不能小于开始时间哦",
"相机": "相机",
"相册": "相册",

View File

@ -1,4 +1,5 @@
import 'package:get/get.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../network/api_repository.dart';
@ -19,7 +20,7 @@ class MarkedHouseStateLogic extends BaseGetXController{
state.lockSetInfoData.value.lockStatus!.roomStatus = state.roomStatus.value;
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
showToast("操作成功");
showToast("操作成功".tr);
}else if(entity.errorCode! == 1){
//

View File

@ -4,6 +4,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 '../../../../blue/blue_manage.dart';
import '../../../../blue/io_protocol/io_setSupportFunctionsNoParameters.dart';
@ -30,7 +31,7 @@ class MotorPowerLogic extends BaseGetXController {
state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue = state.motorTorsion.value;
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
showToast("操作成功");
showToast("操作成功".tr);
}
}
@ -82,29 +83,25 @@ class MotorPowerLogic 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;
}
}
@ -166,7 +163,6 @@ class MotorPowerLogic extends BaseGetXController {
void onReady() {
// TODO: implement onReady
super.onReady();
print("onReady()");
_initReplySubscription();
}
@ -175,7 +171,6 @@ class MotorPowerLogic extends BaseGetXController {
void onInit() {
// TODO: implement onInit
super.onInit();
print("onInit()");
_readSupportFunctionsNoParameters();
}

View File

@ -2,6 +2,7 @@
import 'dart:async';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../blue/blue_manage.dart';
@ -21,12 +22,12 @@ class NormallyOpenModeLogic extends BaseGetXController{
//
void configPassageMode() async{
if(state.weekDays.value.isEmpty){
showToast("请选择常开日期");
showToast("请选择常开日期".tr);
return;
}
if(state.endTimeMinute.value < state.beginTimeMinute.value){
showToast("结束时间不能小于开始时间哦");
showToast("结束时间不能小于开始时间哦".tr);
return;
}
@ -46,7 +47,7 @@ class NormallyOpenModeLogic extends BaseGetXController{
passageModeConfig: passageModeConfig,
);
if(entity.errorCode!.codeIsSuccessful){
showToast("操作成功", something: (){
showToast("操作成功".tr, something: (){
eventBus.fire(RefreshLockListInfoDataEvent());
state.lockSetInfoData.value.lockSettingInfo!.passageMode = state.isOpenNormallyOpenMode.value == true ? 1:0;
@ -109,32 +110,28 @@ class NormallyOpenModeLogic extends BaseGetXController{
int status = reply.data[2];
switch(status){
case 0x00:
//
print("${reply.commandType}数据解析成功");
//
Get.log("${reply.commandType}数据解析成功");
state.sureBtnState.value = 0;
cancelBlueConnetctToastTimer();
dismissEasyLoading();
configPassageMode();
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;
}
}
@ -167,7 +164,6 @@ class NormallyOpenModeLogic extends BaseGetXController{
int index = day % 7; // 0
weekStr = '${weekStr.substring(0, index)}1${weekStr.substring(index + 1)}';
}
// print("weekStrweekStrweekStr:$weekStr");
int number = int.parse(weekStr, radix: 2);
List<int> list = [];
@ -187,12 +183,10 @@ class NormallyOpenModeLogic extends BaseGetXController{
int end2 = endTime % 256;
list.add(end1);
list.add(end2);
// list.add(state.endTimeMinute.value);
list.add(state.isAllDay.value == 1 ? 1:0);
list.add(number);
list.add(0);
// print("listlistlistlist:$list");
IoSenderManage.setSupportFunctionsWithParametersCommand(
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
@ -219,7 +213,6 @@ class NormallyOpenModeLogic extends BaseGetXController{
void onReady() {
// TODO: implement onReady
super.onReady();
print("onReady()");
_initReplySubscription();
}
@ -228,7 +221,6 @@ class NormallyOpenModeLogic extends BaseGetXController{
void onInit() {
// TODO: implement onInit
super.onInit();
print("onInit()");
// _readSupportFunctionsWithParameters();
}

View File

@ -341,14 +341,14 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> with RouteA
// TODO: implement didChangeDependencies
super.didChangeDependencies();
///
//
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
}
@override
void dispose() {
// TODO: implement dispose
///
//
AppRouteObserver().routeObserver.unsubscribe(this);
super.dispose();
}
@ -357,7 +357,6 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> with RouteA
@override
void didPush() {
super.didPush();
print("lockSet===didPush");
state.ifCurrentScreen.value = true;
}
@ -365,7 +364,6 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> with RouteA
@override
void didPop() {
super.didPop();
print("lockSet===didPop");
logic.cancelBlueConnetctToastTimer();
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
BlueManage().stopScan();
@ -377,7 +375,6 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> with RouteA
@override
void didPopNext() {
super.didPopNext();
print("lockSet===didPopNext");
state.ifCurrentScreen.value = true;
}
@ -385,7 +382,6 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> with RouteA
@override
void didPushNext() {
super.didPushNext();
print("lockSet===didPushNext");
logic.cancelBlueConnetctToastTimer();
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
BlueManage().stopScan();