多语言

This commit is contained in:
czz
2025-07-30 16:48:48 +08:00
parent 92b6896176
commit 300e3b31f6
96 changed files with 3741 additions and 2710 deletions

View File

@@ -61,7 +61,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
children: [
// 中间居中的标题
Text(
'设置',
'设置'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
@@ -94,7 +94,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
alignment: Alignment.center,
children: [
Text(
obsData['name']?.toString() ?? '未命名',
obsData['name']?.toString() ?? '未命名'.tr,
style: TextStyle(
color: Colors.white,
fontSize: 40.rpx,
@@ -110,7 +110,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
2 +
_calculateTextHalfWidth(
obsData['name']?.toString() ??
'未命名') +
'未命名'.tr) +
22.rpx,
top: 5.rpx,
child: ClickableContainer(
@@ -141,7 +141,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
),
const SizedBox(height: 4),
Text(obsData['mac']?.toString() ?? '未命名',
Text(obsData['mac'.tr]?.toString() ?? '未命名'.tr,
style: TextStyle(
color: Colors.white70, fontSize: 26.rpx)),
@@ -165,8 +165,8 @@ class _BluetoothPageState extends State<BluetoothPage> {
//下面文字和颜色也根据上面变化
Text(
obsData['blueToothStatus'] == 2
? '已连接'
: '未连接',
? '已连接'.tr
: '未连接'.tr,
style: TextStyle(
color: obsData['blueToothStatus'] == 2
? Color(0xFF6BFDAC)
@@ -185,16 +185,16 @@ class _BluetoothPageState extends State<BluetoothPage> {
children: [
if (isBind) ...[
_buildMenuButton(
context, '详情', "/devicePeopleInfo",
context, '详情'.tr, "/devicePeopleInfo",
arguments: obsData),
_buildMenuButton(
context,
'人员资料',
'人员资料'.tr,
"/peopleInfoPage",
arguments: obsData,
),
_buildMenuButton(
context, '房间选择', "/roomPickerPage",
context, '房间选择'.tr, "/roomPickerPage",
arguments: obsData, onResult: (result) {
if (result != null && result is Map) {
final Map<String, dynamic> safeMap =
@@ -209,29 +209,29 @@ class _BluetoothPageState extends State<BluetoothPage> {
}),
_buildMenuButton(
context,
'设备校准',
'设备校准'.tr,
"/mhtCalibrationAfterPage",
arguments: obsData,
),
_buildMenuButton(
context, '体征传感器', "/vitalSignsSensorPage",
context, '体征传感器'.tr, "/vitalSignsSensorPage",
arguments: obsData),
_buildMenuButton(
context,
'WIFI配置',
'WIFI配置'.tr,
"/mhtWifiAfterPage",
arguments: obsData,
),
// _buildMenuButton(
// context, '睡眠习惯', "/sleepHabitPage"),
_buildMenuButton(
context, '分享设备', "/deviceSharePage",
context, '分享设备'.tr, "/deviceSharePage",
arguments: obsData),
],
if (!isBind) ...[
_buildMenuButton(
context,
obsData['bind_type'] == 1 ? '解绑' : '删除',
obsData['bind_type'] == 1 ? '解绑'.tr : '删除'.tr,
"",
onTap: () async {
// await deviceListController
@@ -255,7 +255,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
// 解绑弹窗
showUnbindConfirmDialog(
context: context,
title: "是否进行解绑?",
title: "是否进行解绑?".tr,
onConfirm: () async {
await deviceListController
.unbindDevice(obsData);
@@ -288,7 +288,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
// 删除弹窗
showDeleteDeviceConfirmDialog(
context: context,
title: "是否进行删除?",
title: "是否进行删除?".tr,
onConfirm: () async {
await deviceListController
.unbindDevice(
@@ -307,20 +307,20 @@ class _BluetoothPageState extends State<BluetoothPage> {
},
),
_buildMenuButton(
context, '详情', "/devicePeopleInfo",
context, '详情'.tr, "/devicePeopleInfo",
arguments: obsData),
],
if (isBind) ...[
_buildMenuButton(
context,
obsData['bind_type'] == 1 ? '解绑' : '删除',
obsData['bind_type'] == 1 ? '解绑'.tr : '删除'.tr,
"",
onTap: () {
if (obsData['bind_type'] == 1) {
// 解绑弹窗
showUnbindConfirmDialog(
context: context,
title: "是否进行解绑?",
title: "是否进行解绑?".tr,
onConfirm: () async {
await deviceListController
.unbindDevice(obsData);
@@ -353,7 +353,7 @@ class _BluetoothPageState extends State<BluetoothPage> {
// 删除弹窗
showDeleteDeviceConfirmDialog(
context: context,
title: "是否进行删除?",
title: "是否进行删除?".tr,
onConfirm: () async {
await deviceListController
.unbindDevice(