Browse Source

feat(国际化): 添加耳机状态相关翻译并修复品牌名称拼写

- 在zh_cn.dart和en_us.dart中添加左耳、右耳、充电仓等翻译字段
- 将硬编码的中文替换为国际化翻译调用
- 修复品牌名称拼写错误(DeepSound -> DeapSound)
- 移除未使用的翻译字段以清理代码
newdev_shunjiawei
lxm 1 year ago
parent
commit
f0035abd84
  1. 85
      lib/core/translations/language/en_us.dart
  2. 8
      lib/core/translations/language/zh_cn.dart
  3. 6
      lib/modules/home/controllers/home_controller.dart
  4. 6
      lib/modules/home/views/home_view.dart

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

@ -140,8 +140,14 @@ const Map<String, String> 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<String, String> 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<String, String> 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<String, String> 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<String, String> enUS = {
"translationSessionRecord": "Translation Session Record",
// 配对模块
// 配对页面
// 配对页面(pairing_view.dart & pairing_view_new.dart)
"devicePairing": "Device Pairing",
"connectYourDeepSoundHeadset": "Connect Your DeepSound Headset",
"bind": "Bind",

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

@ -137,8 +137,14 @@ const Map<String, String> zhCN = {
"unknown": "未知",
'bluetoothTurnedOff': '蓝牙已关闭,请打开蓝牙',
'bluetoothOff': '蓝牙已关闭',
'leftEar': '左耳',
'rightEar': '右耳',
'chargingCase': '充电仓',
'left': '左',
'right': '右',
'checkConnectionStatusFailed': '检查连接状态失败',
// 发现页
// 发现页
"searchAi": "搜索AI功能...",
"exploreSlogan": "智能耳机,无限可能",
"exploreSlogan1": "智能陪伴,无限可能",

6
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() {

6
lib/modules/home/views/home_view.dart

@ -109,7 +109,7 @@ class HomeView extends GetView<HomeController> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'DeepSound',
'DeapSound',
style: TextStyle(
fontSize: 20.sp,
fontWeight: FontWeight.bold,
@ -395,7 +395,7 @@ class HomeView extends GetView<HomeController> {
children: [
// 左耳机
_buildCompactBatteryItem(
label: '左',
label: 'left'.tr, // 左
batteryLevel: leftBattery.value,
isCharging: leftEarCharging.value,
isDarkMode: isDarkMode,
@ -410,7 +410,7 @@ class HomeView extends GetView<HomeController> {
// 右耳机
_buildCompactBatteryItem(
label: '右',
label: 'right'.tr, // 右
batteryLevel: rightBattery.value,
isCharging: rightEarCharging.value,
isDarkMode: isDarkMode,

Loading…
Cancel
Save