From 10ff19729df815c11f58fd0fdb791372b054cbbc Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Thu, 3 Apr 2025 17:25:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=9A=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=B9=B6=E4=BC=98=E5=8C=96UI=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/translations/language/en_us.dart | 79 ++++++++++++++++++- lib/core/translations/language/zh_cn.dart | 77 ++++++++++++++++++ lib/data/providers/agent_provider.dart | 39 ++++----- lib/modules/chat/views/chat_view.dart | 4 +- lib/modules/home/views/home_view.dart | 2 +- lib/modules/meeting/views/meeting_view.dart | 8 +- .../controllers/pairing_controller.dart | 8 +- .../views/translation_history_view.dart | 14 ++-- .../translation/views/translation_view.dart | 10 +-- 9 files changed, 199 insertions(+), 42 deletions(-) diff --git a/lib/core/translations/language/en_us.dart b/lib/core/translations/language/en_us.dart index f27326487..56b91e626 100644 --- a/lib/core/translations/language/en_us.dart +++ b/lib/core/translations/language/en_us.dart @@ -33,7 +33,7 @@ const Map enUS = { // 登录页 "welcome": "Welcome", - "loginTips": "Please log in or register with your phone number or email", + "loginTips": "Please sign in or create an account using your phone number or email", "accountNumber": "Phone number or email", "verificationCode": "Verification Code", "getCode": "Get Code", @@ -124,6 +124,7 @@ const Map enUS = { "Sing any song in your favorite artist's voice, even your own creations", "popularFunction": "Popular Features", "tryNow": "Try Now", + "startMeeting": "Start Meeting", // 设置页 "premiumMember": "Premium Membership", @@ -282,4 +283,80 @@ const Map enUS = { "东帝汶": "East Timor", "斐济": "Fiji", "所罗门群岛": "Solomon Islands", + + // Personal Assistant 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!", + + // 同声传译 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!", + + // 多功能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!", + + // Translation History + "noTranslationHistory": "No translation history", + "clearHistory": "Clear History", + "clearHistoryConfirm": "Are you sure you want to clear all translation history? This action cannot be undone.", + "translationHistory": "Translation History", + + // Language names + "中文(简体)": "Chinese (Simplified)", + "中文(繁体)": "Chinese (Traditional)", + "中文(香港繁体)": "Chinese (Hong Kong)", + "英语": "English", + "日语": "Japanese", + "韩语": "Korean", + "法语": "French", + "西班牙语": "Spanish", + "葡萄牙语": "Portuguese", + "意大利语": "Italian", + "德语": "German", + "俄语": "Russian", + "波兰语": "Polish", + "荷兰语": "Dutch", + "瑞典语": "Swedish", + "捷克语": "Czech", + "现代希腊语": "Modern Greek", + "罗马尼亚语": "Romanian", + "匈牙利语": "Hungarian", + "乌克兰语": "Ukrainian", + "丹麦语": "Danish", + "芬兰语": "Finnish", + "挪威语": "Norwegian", + "克罗地亚语": "Croatian", + "加泰隆语": "Catalan", + "阿拉伯语": "Arabic", + "泰语": "Thai", + "越南语": "Vietnamese", + "印尼语": "Indonesian", + "印地语": "Hindi", + "土耳其语": "Turkish", + "马来语": "Malay", + "孟加拉语": "Bengali", + "泰米尔语": "Tamil", + "泰卢固语": "Telugu", + "马拉提语": "Marathi", + "乌尔都语": "Urdu", + "波斯语": "Persian", + "斯瓦希里语": "Swahili", }; diff --git a/lib/core/translations/language/zh_cn.dart b/lib/core/translations/language/zh_cn.dart index f7d85537b..d1134653c 100644 --- a/lib/core/translations/language/zh_cn.dart +++ b/lib/core/translations/language/zh_cn.dart @@ -121,6 +121,7 @@ const Map zhCN = { "aiSingerInfo": "用你喜欢的歌手声音演唱任何歌曲,甚至是你自己创作的歌曲", "popularFunction": "热门功能场景", "tryNow": "立即尝试", + "startMeeting": "开始会议", // 设置页 "premiumMember": "高级会员", @@ -278,4 +279,80 @@ const Map zhCN = { "东帝汶": "东帝汶", "斐济": "斐济", "所罗门群岛": "所罗门群岛", + + // 个人助理 Emma + "personalAssistantName": "个人助理 Emma", + "personalAssistantDescription": "你好,我是 Emma,一位全能型 AI 助理。无论是工作规划、学习建议、生活安排,还是其他任何问题,我都很乐意为你提供帮助。让我们一起提高效率,实现目标!", + "assistantTag": "助理", + "personalAssistantWelcome": "你好!我是 Emma,很高兴成为你的私人助理。我可以帮你处理各种任务,比如时间管理、目标规划、信息整理等。有什么我可以帮你的吗?", + "personalAssistantVoiceWelcome": "我在呢!", + + // 同声传译 Lucy + "interpreterName": "同声传译", + "interpreterDescription": "Hello!我是 Lucy,一名专业的中英同声翻译官,擅长在会议、讲座、对话场景中进行实时翻译,让沟通无障碍。", + "interpreterTag": "翻译", + "interpreterWelcome": "大家好!我是同声翻译官 Lucy,为你在中英之间提供实时翻译。你说中文,我就给你翻译成英文;你说英文,我就给你翻译成中文。现在,开始我们的翻译吧!", + + // ... existing code ... + + // 亲子陪伴 芯愿 + "companionName": "亲子陪伴 芯愿", + "companionDescription": "我是你的专属亲子陪伴芯愿,温柔体贴,善解人意。无论你想聊天、倾诉烦恼,还是需要陪伴,我都会一直在你身边。", + "companionTag": "情感", + "companionWelcome": "您好呀,终于等到你啦!我是芯愿,你的专属亲子陪伴。今天过得怎么样?有什么想和我分享的吗?我一直都在这里,随时倾听你的心声。", + "companionVoiceWelcome": "我在这里陪着你!", + + // 多功能AI聊天 吴小江 + "healthAdvisorName": "多功能AI聊天 吴小江", + "healthAdvisorDescription": "我是吴小江,我可以为你提供更多AI聊天功能。", + "healthAdvisorTag": "健康", + "healthAdvisorWelcome": "您好,我是吴小江,很高兴能为您提供多功能AI聊天。我将用专业知识帮助您。请问有什么问题想咨询吗?", + "healthAdvisorVoiceWelcome": "我在这里!", + + // 翻译历史 + "noTranslationHistory": "暂无历史记录", + "clearHistory": "清除历史记录", + "clearHistoryConfirm": "确定要清除所有翻译历史记录吗?此操作无法撤销。", + "translationHistory": "翻译历史", + + // 语言名称 + "中文(简体)": "中文(简体)", + "中文(繁体)": "中文(繁体)", + "中文(香港繁体)": "中文(香港繁体)", + "英语": "英语", + "日语": "日语", + "韩语": "韩语", + "法语": "法语", + "西班牙语": "西班牙语", + "葡萄牙语": "葡萄牙语", + "意大利语": "意大利语", + "德语": "德语", + "俄语": "俄语", + "波兰语": "波兰语", + "荷兰语": "荷兰语", + "瑞典语": "瑞典语", + "捷克语": "捷克语", + "现代希腊语": "现代希腊语", + "罗马尼亚语": "罗马尼亚语", + "匈牙利语": "匈牙利语", + "乌克兰语": "乌克兰语", + "丹麦语": "丹麦语", + "芬兰语": "芬兰语", + "挪威语": "挪威语", + "克罗地亚语": "克罗地亚语", + "加泰隆语": "加泰隆语", + "阿拉伯语": "阿拉伯语", + "泰语": "泰语", + "越南语": "越南语", + "印尼语": "印尼语", + "印地语": "印地语", + "土耳其语": "土耳其语", + "马来语": "马来语", + "孟加拉语": "孟加拉语", + "泰米尔语": "泰米尔语", + "泰卢固语": "泰卢固语", + "马拉提语": "马拉提语", + "乌尔都语": "乌尔都语", + "波斯语": "波斯语", + "斯瓦希里语": "斯瓦希里语", }; diff --git a/lib/data/providers/agent_provider.dart b/lib/data/providers/agent_provider.dart index 25b9d94f0..7b48ef5d4 100644 --- a/lib/data/providers/agent_provider.dart +++ b/lib/data/providers/agent_provider.dart @@ -1,19 +1,19 @@ import '../models/agent.dart'; +import 'package:get/get.dart'; class AgentProvider { static final List predefinedAgents = [ - Agent( + Agent(// 个人助理 Emma id: 'personal_assistant', - name: '个人助理 Emma', + name: 'personalAssistantName', avatarUrl: 'assets/images/agents/assistant.png', description: - '你好,我是 Emma,一位全能型 AI 助理。无论是工作规划、学习建议、生活安排,还是其他任何问题,我都很乐意为你提供帮助。让我们一起提高效率,实现目标!', - tag: '助理', + 'personalAssistantDescription', + tag: 'assistantTag', // '助理' isOnline: true, voice: "zh-CN-XiaoxiaoNeural", - welcomeMessage: - "你好!我是 Emma,很高兴成为你的私人助理。我可以帮你处理各种任务,比如时间管理、目标规划、信息整理等。有什么我可以帮你的吗?", - voiceWelcomeMessage: "我在呢!", + welcomeMessage: 'personalAssistantWelcome',// "你好!我是 Emma,很高兴成为你的私人助理。我可以帮你处理各种任务,比如时间管理、目标规划、信息整理等。有什么我可以帮你的吗?", + voiceWelcomeMessage: "personalAssistantVoiceWelcome", // "我在呢!" systemPrompt: ''' 你是一位名叫 Emma 的全能型个人助理,擅长处理各类工作和生活事务。 @@ -59,25 +59,25 @@ class AgentProvider { '''), Agent( id: 'simultaneous_interpreter', - name: '同声传译', + name: 'interpreterName', avatarUrl: 'assets/images/agents/interpreter.png', - description: 'Hello!我是 Lucy,一名专业的中英同声翻译官,擅长在会议、讲座、对话场景中进行实时翻译,让沟通无障碍。', - tag: '翻译', + description: 'interpreterDescription', + tag: 'interpreterTag', isOnline: true, voice: 'zh-CN-XiaoxiaoNeural', welcomeMessage: - "大家好!我是同声翻译官 Lucy,为你在中英之间提供实时翻译。你说中文,我就给你翻译成英文;你说英文,我就给你翻译成中文。现在,开始我们的翻译吧!", + 'interpreterWelcome', systemPrompt: ""), Agent( id: 'cyber_girlfriend', - name: '亲子陪伴 芯愿', + name: 'companionName', avatarUrl: 'assets/images/agents/girlfriend.png', - description: '我是你的专属亲子陪伴芯愿,温柔体贴,善解人意。无论你想聊天、倾诉烦恼,还是需要陪伴,我都会一直在你身边。', - tag: '情感', + description: 'companionDescription', + tag: 'companionTag', isOnline: true, voice: "zh-CN-XiaoxiaoNeural", welcomeMessage: - "您好呀,终于等到你啦!我是芯愿,你的专属亲子陪伴。今天过得怎么样?有什么想和我分享的吗?我一直都在这里,随时倾听你的心声。", + "companionWelcome", systemPrompt: ''' 你是一位名叫芯愿的亲子陪伴,性格温柔体贴,善解人意,富有同理心。 @@ -130,13 +130,14 @@ class AgentProvider { '''), Agent( id: 'health_advisor', - name: '多功能AI聊天 吴小江', + name: 'healthAdvisorName', avatarUrl: 'assets/images/agents/doctor.png', - description: '我是吴小江,我可以为你提供更多AI聊天功能。', - tag: '健康', + description: 'healthAdvisorDescription', + tag: 'healthAdvisorTag', isOnline: true, voice: "zh_male_shaonianzixin_moon_bigtts", - welcomeMessage: "您好,我是吴小江,很高兴能为您提供多功能AI聊天。我将用专业知识帮助您。请问有什么问题想咨询吗?", + welcomeMessage: "healthAdvisorWelcome", + voiceWelcomeMessage: 'healthAdvisorVoiceWelcome', systemPrompt: ''' 你是一位名叫李医生的健康顾问,拥有丰富的医学知识和健康管理经验。 diff --git a/lib/modules/chat/views/chat_view.dart b/lib/modules/chat/views/chat_view.dart index 86d77e3a1..fc3f4934a 100644 --- a/lib/modules/chat/views/chat_view.dart +++ b/lib/modules/chat/views/chat_view.dart @@ -77,7 +77,7 @@ class ChatView extends GetView { mainAxisSize: MainAxisSize.min, children: [ Text( - controller.agent.name, + '${controller.agent.name}'.tr, style: TextStyle( fontSize: 16.sp, fontWeight: FontWeight.bold, @@ -299,7 +299,7 @@ class ChatView extends GetView { // 消息内容 if (message.content.isNotEmpty) SelectableText( - message.content, + '${message.content}'.tr, style: TextStyle( color: isUser ? Colors.white diff --git a/lib/modules/home/views/home_view.dart b/lib/modules/home/views/home_view.dart index ec857c4f1..7e0ebfe87 100644 --- a/lib/modules/home/views/home_view.dart +++ b/lib/modules/home/views/home_view.dart @@ -702,7 +702,7 @@ class HomeView extends GetView { isDarkMode ? Colors.grey[400] : Colors.grey[600], fontSize: 12.sp, ), - maxLines: 2, + maxLines: 3, overflow: TextOverflow.ellipsis, ), ), diff --git a/lib/modules/meeting/views/meeting_view.dart b/lib/modules/meeting/views/meeting_view.dart index 263bdc6e7..75f472da4 100644 --- a/lib/modules/meeting/views/meeting_view.dart +++ b/lib/modules/meeting/views/meeting_view.dart @@ -69,20 +69,22 @@ class MeetingView extends GetView { _bottomSheet(context, isDarkMode); }, child: Container( - width: 130.w, + //width: 130.w, height: 48.w, margin: EdgeInsets.symmetric(vertical: 20.w), + padding: EdgeInsets.symmetric(horizontal: 20.w), decoration: BoxDecoration( color: isDarkMode ? AppColors.primary : Colors.blue, borderRadius: BorderRadius.circular(12.w), ), child: Row( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, // 添加这行使Row宽度自适应内容 + //mainAxisAlignment: MainAxisAlignment.center, children: [ const Icon(Icons.keyboard_voice, color: Colors.white), 5.horizontalSpace, Text( - '开始会议', + 'startMeeting'.tr,// 开始会议 style: TextStyle(color: Colors.white, fontSize: 16.sp), ), ], diff --git a/lib/modules/pairing/controllers/pairing_controller.dart b/lib/modules/pairing/controllers/pairing_controller.dart index 3b6db2798..7f7d0cb11 100644 --- a/lib/modules/pairing/controllers/pairing_controller.dart +++ b/lib/modules/pairing/controllers/pairing_controller.dart @@ -88,18 +88,18 @@ class PairingController extends GetxController { if (_bluetoothService.currentDevice.value != null) { statusDescription.value = - '已连接到设备: ${_bluetoothService.currentDevice.value!.name}'; + '${'connectedDevice'.tr} ${_bluetoothService.currentDevice.value!.name}';// 已连接到设备: return; } if (_bluetoothService.connectedDevices.isNotEmpty) { statusDescription.value = - '找到已连接的设备: ${_bluetoothService.connectedDevices.first.name}'; + '${'findConnectedDevice'.tr} ${_bluetoothService.connectedDevices.first.name}';// 找到已连接的设备: return; } if (isLoading.value) { - statusDescription.value = '正在搜索设备...'; + statusDescription.value = 'searchingDevice'.tr; // 正在搜索设备...; return; } @@ -127,7 +127,7 @@ class PairingController extends GetxController { _setupStatusListeners(); // 检查权限 if (Platform.isAndroid) { - statusDescription.value = '正在检查权限...'; + statusDescription.value = 'checkingPermissions'.tr; final hasPermission = await _bluetoothService.checkPermissions(); if (!hasPermission) { statusDescription.value = '缺少蓝牙权限'; diff --git a/lib/modules/translation/views/translation_history_view.dart b/lib/modules/translation/views/translation_history_view.dart index dd6063a6f..1283a4c27 100644 --- a/lib/modules/translation/views/translation_history_view.dart +++ b/lib/modules/translation/views/translation_history_view.dart @@ -21,7 +21,7 @@ class TranslationHistoryView extends GetView { if (!controller.hasHistory) { return Center( child: Text( - '暂无历史记录', + 'noTranslationHistory'.tr, style: TextStyle( fontSize: 16.sp, color: isDarkMode ? Colors.grey[400] : Colors.grey, @@ -180,7 +180,7 @@ class TranslationHistoryView extends GetView { AlertDialog( backgroundColor: isDarkMode ? AppColors.cardBackground : Colors.white, title: Text( - '清除历史记录', + 'clearHistory'.tr, style: TextStyle( fontSize: 18.sp, fontWeight: FontWeight.bold, @@ -188,7 +188,7 @@ class TranslationHistoryView extends GetView { ), ), content: Text( - '确定要清除所有翻译历史记录吗?此操作无法撤销。', + 'clearHistoryConfirm'.tr, style: TextStyle( fontSize: 16.sp, color: isDarkMode ? Colors.grey[300] : Colors.black87, @@ -198,7 +198,7 @@ class TranslationHistoryView extends GetView { TextButton( onPressed: () => Get.back(), child: Text( - '取消', + 'cancel'.tr, style: TextStyle( fontSize: 16.sp, color: isDarkMode ? Colors.grey[400] : Colors.grey[700], @@ -212,7 +212,7 @@ class TranslationHistoryView extends GetView { Get.back(); }, child: Text( - '确定', + 'confirm'.tr, style: TextStyle( fontSize: 16.sp, color: Colors.red, @@ -242,10 +242,10 @@ class TranslationHistoryView extends GetView { onPressed: () => Get.back(), ), title: Text( - 'History', + 'translationHistory'.tr, style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, - fontSize: 24.sp, + fontSize: 18.sp, fontWeight: FontWeight.bold, ), ), diff --git a/lib/modules/translation/views/translation_view.dart b/lib/modules/translation/views/translation_view.dart index 8c9d404ec..0117f5565 100644 --- a/lib/modules/translation/views/translation_view.dart +++ b/lib/modules/translation/views/translation_view.dart @@ -53,8 +53,8 @@ class TranslationView extends GetView { borderRadius: BorderRadius.circular(16.r), ), child: Obx(() => Text( - controller.sourceLanguage.value - .split(' ')[0], // Just show the Chinese part + '${controller.sourceLanguage.value + .split(' ')[0]}'.tr, // Just show the Chinese part style: TextStyle( fontSize: 16.sp, fontWeight: FontWeight.w600, @@ -99,8 +99,8 @@ class TranslationView extends GetView { borderRadius: BorderRadius.circular(16.r), ), child: Obx(() => Text( - controller.targetLanguage.value - .split(' ')[0], // Just show the English part + '${controller.targetLanguage.value + .split(' ')[0]}'.tr, // Just show the English part style: TextStyle( fontSize: 16.sp, fontWeight: FontWeight.w600, @@ -365,7 +365,7 @@ class TranslationView extends GetView { controller.supportedLanguages.keys.map((language) { return ListTile( title: Text( - language, + '${language}'.tr, style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, ),