Browse Source

feat(翻译): 添加系统设置、权限管理和实时语音对话的翻译项

- 在中文和英文翻译文件中新增多个设置项相关翻译
- 更新设置页面以使用新的翻译键
- 修复部分翻译项的格式对齐问题
newdev_shunjiawei
lxm 1 year ago
parent
commit
16bf0274f0
  1. 21
      lib/core/translations/language/en_us.dart
  2. 14
      lib/core/translations/language/zh_cn.dart
  3. 49
      lib/modules/settings/views/settings_view.dart

21
lib/core/translations/language/en_us.dart

@ -145,9 +145,9 @@ const Map<String, String> enUS = {
'chargingCase': 'Charging Case', 'chargingCase': 'Charging Case',
'left': 'Left', 'left': 'Left',
'right': 'Right', 'right': 'Right',
'checkConnectionStatusFailed': 'Failed to check connection status', 'checkConnectionStatusFailed': 'Failed to check connection status',
// 发现页 // 发现页
"searchAi": "Search AI features...", "searchAi": "Search AI features...",
"exploreSlogan": "Smart Earbuds, Infinite Possibilities", "exploreSlogan": "Smart Earbuds, Infinite Possibilities",
"exploreSlogan1": "Intelligent companion, Infinite Possibilities", "exploreSlogan1": "Intelligent companion, Infinite Possibilities",
@ -198,6 +198,7 @@ const Map<String, String> enUS = {
'meetingTranscript': 'Meeting Transcript', 'meetingTranscript': 'Meeting Transcript',
// 设置页 // 设置页
"systemSettings": "System Settings",
"premiumMember": "Premium Membership", "premiumMember": "Premium Membership",
"joinDevice": "Connected device:", "joinDevice": "Connected device:",
"accountId": "Account ID:", "accountId": "Account ID:",
@ -210,6 +211,8 @@ const Map<String, String> enUS = {
"lastBackup": "Last backup:", "lastBackup": "Last backup:",
"privacySettings": "Privacy Settings", "privacySettings": "Privacy Settings",
"privacySettingsInfo": "Manage data collection and permissions", "privacySettingsInfo": "Manage data collection and permissions",
"permissionManagement": "Permission Management", // 权限管理
"permissionManagementInfo": "Manage app permission settings", // 管理应用权限设置
"logout": "Log Out", "logout": "Log Out",
"logoutTips": "Are you sure you want to log out of the current account?", "logoutTips": "Are you sure you want to log out of the current account?",
"aboutApplication": "About", "aboutApplication": "About",
@ -237,6 +240,16 @@ const Map<String, String> enUS = {
'deleteAccount': 'Delete Account', 'deleteAccount': 'Delete Account',
'deleteAccountTips': 'deleteAccountTips':
'Are you sure you want to permanently delete your account? This action cannot be undone.', 'Are you sure you want to permanently delete your account? This action cannot be undone.',
"firmwareUpgrade": "Firmware Upgrade", // 固件升级
"bleHeadsetFirmwareUpgrade": "BLE Headset Firmware Upgrade", // BLE耳机固件版本升级
"deviceManagement": "Device Management", // 设备管理
"manageConnectedDevices": "Manage Connected Bluetooth Devices", // 管理已绑定的蓝牙设备
// 设置页面 - 实时语音对话
'realtimeVoiceChat': 'Real-time Voice Chat',
'realtimeVoiceChatInfo':
'Experience intelligent voice interaction features (Preview)',
'loading': 'Loading...',
// 聊天页 // 聊天页
"clearChatHistory": "Clear Chat History", "clearChatHistory": "Clear Chat History",
@ -396,7 +409,7 @@ const Map<String, String> enUS = {
"renameAudioFile": "Rename Audio File", "renameAudioFile": "Rename Audio File",
"enterNewFileName": "Please enter new file name", "enterNewFileName": "Please enter new file name",
// 翻译详情页(translation_detail_view.dart) // 翻译详情页
"originalRecord": "Original Record", "originalRecord": "Original Record",
"recordSummary": "Record Summary", "recordSummary": "Record Summary",
"clickToGenerateSummary": "clickToGenerateSummary":
@ -421,7 +434,7 @@ const Map<String, String> enUS = {
"translationSessionRecord": "Translation Session Record", "translationSessionRecord": "Translation Session Record",
// 配对模块 // 配对模块
// 配对页面(pairing_view.dart & pairing_view_new.dart) // 配对页面
"devicePairing": "Device Pairing", "devicePairing": "Device Pairing",
"connectYourDeepSoundHeadset": "Connect Your DeepSound Headset", "connectYourDeepSoundHeadset": "Connect Your DeepSound Headset",
"bind": "Bind", "bind": "Bind",

14
lib/core/translations/language/zh_cn.dart

@ -142,7 +142,7 @@ const Map<String, String> zhCN = {
'chargingCase': '充电仓', 'chargingCase': '充电仓',
'left': '左', 'left': '左',
'right': '右', 'right': '右',
'checkConnectionStatusFailed': '检查连接状态失败', 'checkConnectionStatusFailed': '检查连接状态失败',
// 发现页 // 发现页
"searchAi": "搜索AI功能...", "searchAi": "搜索AI功能...",
@ -193,6 +193,7 @@ const Map<String, String> zhCN = {
'meetingTranscript': '会议原文', 'meetingTranscript': '会议原文',
// 设置页 // 设置页
"systemSettings": "系统设置",
"premiumMember": "高级会员", "premiumMember": "高级会员",
"joinDevice": "已连接设备:", "joinDevice": "已连接设备:",
"accountId": "账号ID:", "accountId": "账号ID:",
@ -205,6 +206,8 @@ const Map<String, String> zhCN = {
"lastBackup": "上次备份:", "lastBackup": "上次备份:",
"privacySettings": "隐私设置", "privacySettings": "隐私设置",
"privacySettingsInfo": "管理数据收集和权限", "privacySettingsInfo": "管理数据收集和权限",
"permissionManagement": "权限管理", // 权限管理
"permissionManagementInfo": "管理应用权限设置", // 管理应用权限设置
"logout": "退出登录", "logout": "退出登录",
"logoutTips": "确定要退出当前账号吗?", "logoutTips": "确定要退出当前账号吗?",
"aboutApplication": "关于应用", "aboutApplication": "关于应用",
@ -229,6 +232,15 @@ const Map<String, String> zhCN = {
'completeRecording': '完成录制', 'completeRecording': '完成录制',
'deleteAccount': '注销账号', 'deleteAccount': '注销账号',
'deleteAccountTips': '确定要永久删除您的账号吗?此操作不可撤销', 'deleteAccountTips': '确定要永久删除您的账号吗?此操作不可撤销',
"firmwareUpgrade": "固件升级",
"bleHeadsetFirmwareUpgrade": "BLE耳机固件版本升级",
"deviceManagement": "设备管理",
"manageConnectedDevices": "管理已绑定的蓝牙设备",
// 设置页面 - 实时语音对话
"realtimeVoiceChat": "实时语音对话",
"realtimeVoiceChatInfo": "体验智能语音交互功能(功能预览)",
"loading": "加载中...",
// 聊天页 // 聊天页
"clearChatHistory": "清空聊天记录", "clearChatHistory": "清空聊天记录",

49
lib/modules/settings/views/settings_view.dart

@ -203,7 +203,7 @@ class SettingsView extends GetView<SettingsController> {
controller.userInfo.value.viplv] ?? controller.userInfo.value.viplv] ??
'Unknown'; 'Unknown';
return Text( return Text(
membershipString, membershipString.tr, // 会员等级
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
color: Colors.white, color: Colors.white,
@ -327,7 +327,7 @@ class SettingsView extends GetView<SettingsController> {
: Colors.cyan[100]!, : Colors.cyan[100]!,
iconColor: iconColor:
isDarkMode ? Colors.cyan[300]! : Colors.cyan[600]!, isDarkMode ? Colors.cyan[300]! : Colors.cyan[600]!,
value: controller.timbreName.value.tr, value: controller.timbreName.value.tr, // 当前音色
valueStyle: TextStyle( valueStyle: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: isDarkMode ? Colors.white70 : Colors.grey[500], color: isDarkMode ? Colors.white70 : Colors.grey[500],
@ -345,8 +345,8 @@ class SettingsView extends GetView<SettingsController> {
: Colors.grey[200]), : Colors.grey[200]),
// 实时对话入口 // 实时对话入口
_buildSimpleNavigationSetting( _buildSimpleNavigationSetting(
title: '实时语音对话', title: 'realtimeVoiceChat'.tr, // 实时语音对话
subtitle: '体验智能语音交互功能(功能预览)', subtitle: 'realtimeVoiceChatInfo'.tr, // 实时语音对话信息
icon: Icons.chat_bubble_outline, icon: Icons.chat_bubble_outline,
iconBgColor: isDarkMode iconBgColor: isDarkMode
? Colors.purple[900]!.withOpacity(0.3) ? Colors.purple[900]!.withOpacity(0.3)
@ -412,7 +412,7 @@ class SettingsView extends GetView<SettingsController> {
Obx( Obx(
() => _buildSimpleNavigationSetting( () => _buildSimpleNavigationSetting(
title: 'languageSetting'.tr, // 语言设置 title: 'languageSetting'.tr, // 语言设置
subtitle: controller.language.value.name.tr, subtitle: controller.language.value.name.tr, // 当前语言
icon: Icons.language, icon: Icons.language,
iconBgColor: isDarkMode iconBgColor: isDarkMode
? Colors.indigo[900]!.withOpacity(0.3) ? Colors.indigo[900]!.withOpacity(0.3)
@ -506,7 +506,7 @@ class SettingsView extends GetView<SettingsController> {
// 清除配对设备 // 清除配对设备
_buildSimpleNavigationSetting( _buildSimpleNavigationSetting(
title: 'deviceManagement'.tr, // 设备管理 title: 'deviceManagement'.tr, // 设备管理
subtitle: 'deviceManagementInfo'.tr, // 设备管理列表 subtitle: 'manageConnectedDevices'.tr, // 管理已绑定的蓝牙设备
icon: Icons.settings_bluetooth, icon: Icons.settings_bluetooth,
iconBgColor: isDarkMode iconBgColor: isDarkMode
? Colors.red[900]!.withOpacity(0.3) ? Colors.red[900]!.withOpacity(0.3)
@ -633,8 +633,8 @@ class SettingsView extends GetView<SettingsController> {
// : Colors.grey[200]), // : Colors.grey[200]),
// 测试ble耳机固件版本升级 // 测试ble耳机固件版本升级
_buildSimpleNavigationSetting( _buildSimpleNavigationSetting(
title: '固件升级'.tr, title: 'firmwareUpgrade'.tr, // 固件升级
subtitle: 'ble耳机固件版本升级'.tr, subtitle: 'bleHeadsetFirmwareUpgrade'.tr, // BLE耳机固件版本升级
icon: Icons.system_update_alt, icon: Icons.system_update_alt,
iconBgColor: isDarkMode iconBgColor: isDarkMode
? Colors.orange[900]!.withOpacity(0.3) ? Colors.orange[900]!.withOpacity(0.3)
@ -651,14 +651,21 @@ class SettingsView extends GetView<SettingsController> {
: Colors.grey[200]), : Colors.grey[200]),
// 添加权限管理设置项 // 添加权限管理设置项
_buildSettingItem( _buildSimpleNavigationSetting(
title: 'permissionManagement'.tr, // 权限管理
subtitle: 'permissionManagementInfo'.tr, // 管理应用权限设置
icon: Icons.security, icon: Icons.security,
iconColor: Colors.orange, iconBgColor: isDarkMode
title: '权限管理'.tr, ? Colors.orange[900]!.withOpacity(0.3)
isDarkMode: isDarkMode, : Colors.orange[100]!,
iconColor:
isDarkMode ? Colors.orange[300]! : Colors.orange[600]!,
titleColor: isDarkMode ? Colors.white : null,
subtitleColor: isDarkMode ? Colors.white70 : null,
onTap: () { onTap: () {
Get.toNamed(Routes.permissions); Get.toNamed(Routes.permissions);
}, },
isDarkMode: isDarkMode,
), ),
], ],
), ),
@ -750,8 +757,8 @@ class SettingsView extends GetView<SettingsController> {
Obx(() => Text( Obx(() => Text(
// 如果版本信息为空,显示加载中 // 如果版本信息为空,显示加载中
controller.appVersion.value.isEmpty controller.appVersion.value.isEmpty
? '${'versions'.tr} 加载中...' ? '${'versions'.tr} ${'loading'.tr}' // 版本 加载中
: '${'versions'.tr} ${controller.appVersion.value} (Build ${controller.buildNumber.value})', : '${'versions'.tr} ${controller.appVersion.value} (Build ${controller.buildNumber.value})', // 版本号
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: isDarkMode color: isDarkMode
@ -784,7 +791,7 @@ class SettingsView extends GetView<SettingsController> {
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(16.r),
), ),
child: Text( child: Text(
'checkUpdates'.tr, 'checkUpdates'.tr, // 检查更新
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: color:
@ -825,7 +832,7 @@ class SettingsView extends GetView<SettingsController> {
Get.locale?.countryCode == 'CN') Get.locale?.countryCode == 'CN')
InkWell( InkWell(
onTap: () => Get.to( onTap: () => Get.to(
() => const WebViewPage( () => WebViewPage(
url: 'https://beian.miit.gov.cn', url: 'https://beian.miit.gov.cn',
title: 'ICP备案信息', title: 'ICP备案信息',
), ),
@ -1191,7 +1198,7 @@ class SettingsView extends GetView<SettingsController> {
return Container( return Container(
constraints: BoxConstraints(maxWidth: 120.w), // 限制最大宽度 constraints: BoxConstraints(maxWidth: 120.w), // 限制最大宽度
child: Text( child: Text(
'$serviceName'.tr, '$serviceName'.tr, // 语音服务名称
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: isDarkMode ? Colors.white70 : Colors.grey[600], color: isDarkMode ? Colors.white70 : Colors.grey[600],
@ -1284,7 +1291,7 @@ class SettingsView extends GetView<SettingsController> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'${service['name']}'.tr, '${service['name']}'.tr, // 服务名称
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -1296,7 +1303,7 @@ class SettingsView extends GetView<SettingsController> {
), ),
SizedBox(height: 4.h), SizedBox(height: 4.h),
Text( Text(
'${service['description']}'.tr, '${service['description']}'.tr, // 服务描述
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: isDarkMode color: isDarkMode
@ -1421,7 +1428,7 @@ class SettingsView extends GetView<SettingsController> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
language.name.tr, language.name.tr, // 语言名称
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -1433,7 +1440,7 @@ class SettingsView extends GetView<SettingsController> {
), ),
), ),
Text( Text(
language.alias, // 这里使用原始名称,不加 .tr language.alias, // 语言别名(原始名称,不加.tr)
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: isDarkMode color: isDarkMode

Loading…
Cancel
Save