From f0035abd84ea09f3b0f37cded8c7d00dc0db4cb3 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Tue, 8 Jul 2025 00:58:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=BD=E9=99=85=E5=8C=96):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=80=B3=E6=9C=BA=E7=8A=B6=E6=80=81=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=B9=B6=E4=BF=AE=E5=A4=8D=E5=93=81=E7=89=8C?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=8B=BC=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在zh_cn.dart和en_us.dart中添加左耳、右耳、充电仓等翻译字段 - 将硬编码的中文替换为国际化翻译调用 - 修复品牌名称拼写错误(DeepSound -> DeapSound) - 移除未使用的翻译字段以清理代码 --- lib/core/translations/language/en_us.dart | 85 ++++++------------- lib/core/translations/language/zh_cn.dart | 8 +- .../home/controllers/home_controller.dart | 6 +- lib/modules/home/views/home_view.dart | 6 +- 4 files changed, 40 insertions(+), 65 deletions(-) diff --git a/lib/core/translations/language/en_us.dart b/lib/core/translations/language/en_us.dart index 88efa50c7..9843f8c4f 100644 --- a/lib/core/translations/language/en_us.dart +++ b/lib/core/translations/language/en_us.dart @@ -140,8 +140,14 @@ const Map enUS = { "unknown": "Unknown", 'bluetoothTurnedOff': 'Bluetooth is turned off, please turn it on', 'bluetoothOff': 'bluetooth is off', + 'leftEar': 'Left Ear', + 'rightEar': 'Right Ear', + 'chargingCase': 'Charging Case', + 'left': 'Left', + 'right': 'Right', +'checkConnectionStatusFailed': 'Failed to check connection status', - // 发现页 +// 发现页 "searchAi": "Search AI features...", "exploreSlogan": "Smart Earbuds, Infinite Possibilities", "exploreSlogan1": "Intelligent companion, Infinite Possibilities", @@ -239,26 +245,6 @@ const Map enUS = { "imListening": "Listening...", "canStartTalking": "You may start speaking", - // 翻译模块 - // 翻译主页 - "translationHistory": "Translation History", - "enableRecording": "Enable Recording", - "viewAudioFiles": "View Audio Files", - "headsetUser": "Headset User", - "phoneUser": "Phone User", - "selectSourceLanguage": "Select Source Language", - "selectTargetLanguage": "Select Target Language", - - // 翻译历史页 - "noTranslationHistory": "No translation history", - "clearHistory": "Clear History", - "clearHistoryConfirm": - "Are you sure you want to clear all translation history? This action cannot be undone.", - "unknownLanguage": "Unknown Language", - "deleteSessionRecord": "Delete Session Record", - "deleteSessionConfirm": - "Are you sure you want to delete all translation records for this session? This action cannot be undone.", - // 编辑个人信息页 "editProfile": "Edit Profile", "nickname": "Nickname", @@ -372,48 +358,31 @@ const Map enUS = { "斐济": "Fiji", "所罗门群岛": "Solomon Islands", - // 个人助理Emma - "personalAssistantName": "Emma", - "personalAssistantDescription": - "Hi, I'm Emma, a versatile AI assistant. Whether it's work planning, study advice, life arrangements, or any other issues, I'm happy to help. Let's improve efficiency and achieve goals together!", - "assistantTag": "Assistant", - "personalAssistantWelcome": - "Hello! I'm Emma, and I'm happy to be your personal assistant. I can help you with various tasks such as time management, goal planning, information organization, etc. What can I help you with?", - "personalAssistantVoiceWelcome": "I'm here!", - // 导航 "driving": "Driving", "walking": "Walking", "bicycling": "Cycling", "tsransit": "Transit", - // 同声传译Lucy - "interpreterName": "Simultaneous Interpreter", - "interpreterDescription": - "Hi! I'm Lucy, a professional English-Chinese interpreter specializing in real-time translation for meetings, lectures, and conversations, making communication barrier-free.", - "interpreterTag": "Translation", - "interpreterWelcome": - "Hello everyone! I'm Lucy, your simultaneous interpreter. I'll translate between Chinese and English for you. When you speak Chinese, I'll translate to English; when you speak English, I'll translate to Chinese. Let's start our translation session!", - - // ... existing code ... - - // 亲子陪伴芯愿 - "companionName": "XinYuan", - "companionDescription": - "I am XinYuan, your dedicated parent-child companion, gentle and understanding. Whether you want to chat, share concerns, or need companionship, I'll always be by your side.", - "companionTag": "Emotional", - "companionWelcome": - "Hello! Finally meeting you! I'm XinYuan, your dedicated parent-child companion. How was your day? Is there anything you'd like to share with me? I'm always here, ready to listen to your thoughts.", - "companionVoiceWelcome": "I'm here with you!", + // 翻译模块 + // 翻译主页 + "translationHistory": "Translation History", + "enableRecording": "Enable Recording", + "viewAudioFiles": "View Audio Files", + "headsetUser": "Headset User", + "phoneUser": "Phone User", + "selectSourceLanguage": "Select Source Language", + "selectTargetLanguage": "Select Target Language", - // 多功能AI聊天吴小江 - "healthAdvisorName": "AI Chat Assistant Wu", - "healthAdvisorDescription": - "I'm Wu, ready to provide you with various AI chat features.", - "healthAdvisorTag": "Chat", - "healthAdvisorWelcome": - "Hello, I'm Wu. I'm happy to assist you with AI chat features. How may I help you today?", - "healthAdvisorVoiceWelcome": "I'm here!", + // 翻译历史页 + "noTranslationHistory": "No translation history", + "clearHistory": "Clear History", + "clearHistoryConfirm": + "Are you sure you want to clear all translation history? This action cannot be undone.", + "unknownLanguage": "Unknown Language", + "deleteSessionRecord": "Delete Session Record", + "deleteSessionConfirm": + "Are you sure you want to delete all translation records for this session? This action cannot be undone.", // 翻译音频文件列表页 "translateAudioFiles": "Translate Audio Files", @@ -427,7 +396,7 @@ const Map enUS = { "renameAudioFile": "Rename Audio File", "enterNewFileName": "Please enter new file name", - // 翻译详情页 + // 翻译详情页(translation_detail_view.dart) "originalRecord": "Original Record", "recordSummary": "Record Summary", "clickToGenerateSummary": @@ -452,7 +421,7 @@ const Map enUS = { "translationSessionRecord": "Translation Session Record", // 配对模块 - // 配对页面 + // 配对页面(pairing_view.dart & pairing_view_new.dart) "devicePairing": "Device Pairing", "connectYourDeepSoundHeadset": "Connect Your DeepSound Headset", "bind": "Bind", diff --git a/lib/core/translations/language/zh_cn.dart b/lib/core/translations/language/zh_cn.dart index 17db3d61f..8c3a011cc 100644 --- a/lib/core/translations/language/zh_cn.dart +++ b/lib/core/translations/language/zh_cn.dart @@ -137,8 +137,14 @@ const Map zhCN = { "unknown": "未知", 'bluetoothTurnedOff': '蓝牙已关闭,请打开蓝牙', 'bluetoothOff': '蓝牙已关闭', + 'leftEar': '左耳', + 'rightEar': '右耳', + 'chargingCase': '充电仓', + 'left': '左', + 'right': '右', +'checkConnectionStatusFailed': '检查连接状态失败', - // 发现页 +// 发现页 "searchAi": "搜索AI功能...", "exploreSlogan": "智能耳机,无限可能", "exploreSlogan1": "智能陪伴,无限可能", diff --git a/lib/modules/home/controllers/home_controller.dart b/lib/modules/home/controllers/home_controller.dart index 701291cba..5cf163904 100644 --- a/lib/modules/home/controllers/home_controller.dart +++ b/lib/modules/home/controllers/home_controller.dart @@ -129,7 +129,7 @@ class HomeController extends GetxController { update(); } catch (e) { - Logger.e(_tag, '检查连接状态失败: $e'); + Logger.e(_tag, '${'checkConnectionStatusFailed'.tr}: $e'); if (_isFullyConnected.value) { _isFullyConnected.value = false; _isFullyConnected.refresh(); @@ -217,7 +217,7 @@ class HomeController extends GetxController { rightStatus = deviceInfo.value!.rightEarCharging ? '$rightStatus ⚡' : rightStatus; - return '左耳: $leftStatus / 右耳: $rightStatus'; + return '${'leftEar'.tr}: $leftStatus / ${'rightEar'.tr}: $rightStatus'; // 左耳: xxx / 右耳: xxx } String getCaseText() { @@ -232,7 +232,7 @@ class HomeController extends GetxController { caseStatus = '$caseStatus ⚡'; } - return '充电仓: $caseStatus'; + return '${'chargingCase'.tr}: $caseStatus'; // 充电仓: xxx } String getChargingText() { diff --git a/lib/modules/home/views/home_view.dart b/lib/modules/home/views/home_view.dart index f447a9839..c24af6607 100644 --- a/lib/modules/home/views/home_view.dart +++ b/lib/modules/home/views/home_view.dart @@ -109,7 +109,7 @@ class HomeView extends GetView { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - 'DeepSound', + 'DeapSound', style: TextStyle( fontSize: 20.sp, fontWeight: FontWeight.bold, @@ -395,7 +395,7 @@ class HomeView extends GetView { children: [ // 左耳机 _buildCompactBatteryItem( - label: '左', + label: 'left'.tr, // 左 batteryLevel: leftBattery.value, isCharging: leftEarCharging.value, isDarkMode: isDarkMode, @@ -410,7 +410,7 @@ class HomeView extends GetView { // 右耳机 _buildCompactBatteryItem( - label: '右', + label: 'right'.tr, // 右 batteryLevel: rightBattery.value, isCharging: rightEarCharging.value, isDarkMode: isDarkMode,