tanlongsheng 2 years ago
parent
commit
cf52f5caa6
  1. 12
      ios/Runner/Info.plist
  2. 4
      ios/Runner/en.lproj/InfoPlist.strings
  3. 3
      ios/Runner/zh.lproj/InfoPlist.strings
  4. 79
      lib/core/translations/language/en_us.dart
  5. 77
      lib/core/translations/language/zh_cn.dart
  6. 39
      lib/data/providers/agent_provider.dart
  7. 4
      lib/modules/chat/views/chat_view.dart
  8. 2
      lib/modules/home/views/home_view.dart
  9. 8
      lib/modules/meeting/views/meeting_view.dart
  10. 12
      lib/modules/pairing/controllers/pairing_controller.dart
  11. 46
      lib/modules/settings/views/settings_view.dart
  12. 14
      lib/modules/translation/views/translation_history_view.dart
  13. 10
      lib/modules/translation/views/translation_view.dart

12
ios/Runner/Info.plist

@ -40,8 +40,8 @@
<string>DeepSound</string> <string>DeepSound</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>NSUserTrackingUsageDescription</key> <key>NSUserTrackingUsageDescription</key>
<string>This application needs to access your tracking data in order to offer better personalized services and advertisements</string> <string>UserTrackingUsageDescription</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
@ -59,13 +59,13 @@
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSBluetoothAlwaysUsageDescription</key> <key>NSBluetoothAlwaysUsageDescription</key>
<string>需要蓝牙权限来连接和管理音频设备</string> <string>BluetoothUsageDescription</string>
<key>NSBluetoothPeripheralUsageDescription</key> <key>NSBluetoothPeripheralUsageDescription</key>
<string>需要蓝牙权限来连接和管理音频设备</string> <string>BluetoothUsageDescription</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>需要麦克风权限来进行语音识别</string> <string>MicrophoneUsageDescription</string>
<key>NSSpeechRecognitionUsageDescription</key> <key>NSSpeechRecognitionUsageDescription</key>
<string>需要语音识别权限来提供语音交互服务</string> <string>SpeechRecognitionUsageDescription</string>
<key>UIApplicationSupportsIndirectInputEvents</key> <key>UIApplicationSupportsIndirectInputEvents</key>
<true/> <true/>
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>

4
ios/Runner/en.lproj/InfoPlist.strings

@ -0,0 +1,4 @@
"BluetoothUsageDescription" = "Bluetooth permission is required to connect and manage audio devices";
"MicrophoneUsageDescription" = "Microphone permission is required for voice recognition";
"SpeechRecognitionUsageDescription" = "Speech recognition permission is required to provide voice interaction services";
"UserTrackingUsageDescription" = "This application needs to access your tracking data in order to offer better personalized services and advertisements";

3
ios/Runner/zh.lproj/InfoPlist.strings

@ -0,0 +1,3 @@
"BluetoothUsageDescription" = "需要蓝牙权限来连接和管理音频设备";
"MicrophoneUsageDescription" = "需要麦克风权限来进行语音识别";
"SpeechRecognitionUsageDescription" = "需要语音识别权限来提供语音交互服务";

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

@ -33,7 +33,7 @@ const Map<String, String> enUS = {
// 登录页 // 登录页
"welcome": "Welcome", "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", "accountNumber": "Phone number or email",
"verificationCode": "Verification Code", "verificationCode": "Verification Code",
"getCode": "Get Code", "getCode": "Get Code",
@ -124,6 +124,7 @@ const Map<String, String> enUS = {
"Sing any song in your favorite artist's voice, even your own creations", "Sing any song in your favorite artist's voice, even your own creations",
"popularFunction": "Popular Features", "popularFunction": "Popular Features",
"tryNow": "Try Now", "tryNow": "Try Now",
"startMeeting": "Start Meeting",
// 设置页 // 设置页
"premiumMember": "Premium Membership", "premiumMember": "Premium Membership",
@ -282,4 +283,80 @@ const Map<String, String> enUS = {
"东帝汶": "East Timor", "东帝汶": "East Timor",
"斐济": "Fiji", "斐济": "Fiji",
"所罗门群岛": "Solomon Islands", "所罗门群岛": "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",
}; };

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

@ -121,6 +121,7 @@ const Map<String, String> zhCN = {
"aiSingerInfo": "用你喜欢的歌手声音演唱任何歌曲,甚至是你自己创作的歌曲", "aiSingerInfo": "用你喜欢的歌手声音演唱任何歌曲,甚至是你自己创作的歌曲",
"popularFunction": "热门功能场景", "popularFunction": "热门功能场景",
"tryNow": "立即尝试", "tryNow": "立即尝试",
"startMeeting": "开始会议",
// 设置页 // 设置页
"premiumMember": "高级会员", "premiumMember": "高级会员",
@ -278,4 +279,80 @@ const Map<String, String> 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": "翻译历史",
// 语言名称
"中文(简体)": "中文(简体)",
"中文(繁体)": "中文(繁体)",
"中文(香港繁体)": "中文(香港繁体)",
"英语": "英语",
"日语": "日语",
"韩语": "韩语",
"法语": "法语",
"西班牙语": "西班牙语",
"葡萄牙语": "葡萄牙语",
"意大利语": "意大利语",
"德语": "德语",
"俄语": "俄语",
"波兰语": "波兰语",
"荷兰语": "荷兰语",
"瑞典语": "瑞典语",
"捷克语": "捷克语",
"现代希腊语": "现代希腊语",
"罗马尼亚语": "罗马尼亚语",
"匈牙利语": "匈牙利语",
"乌克兰语": "乌克兰语",
"丹麦语": "丹麦语",
"芬兰语": "芬兰语",
"挪威语": "挪威语",
"克罗地亚语": "克罗地亚语",
"加泰隆语": "加泰隆语",
"阿拉伯语": "阿拉伯语",
"泰语": "泰语",
"越南语": "越南语",
"印尼语": "印尼语",
"印地语": "印地语",
"土耳其语": "土耳其语",
"马来语": "马来语",
"孟加拉语": "孟加拉语",
"泰米尔语": "泰米尔语",
"泰卢固语": "泰卢固语",
"马拉提语": "马拉提语",
"乌尔都语": "乌尔都语",
"波斯语": "波斯语",
"斯瓦希里语": "斯瓦希里语",
}; };

39
lib/data/providers/agent_provider.dart

@ -1,19 +1,19 @@
import '../models/agent.dart'; import '../models/agent.dart';
import 'package:get/get.dart';
class AgentProvider { class AgentProvider {
static final List<Agent> predefinedAgents = [ static final List<Agent> predefinedAgents = [
Agent( Agent(// 个人助理 Emma
id: 'personal_assistant', id: 'personal_assistant',
name: '个人助理 Emma', name: 'personalAssistantName',
avatarUrl: 'assets/images/agents/assistant.png', avatarUrl: 'assets/images/agents/assistant.png',
description: description:
'你好,我是 Emma,一位全能型 AI 助理。无论是工作规划、学习建议、生活安排,还是其他任何问题,我都很乐意为你提供帮助。让我们一起提高效率,实现目标!', 'personalAssistantDescription',
tag: '助理', tag: 'assistantTag', // '助理'
isOnline: true, isOnline: true,
voice: "zh-CN-XiaoxiaoNeural", voice: "zh-CN-XiaoxiaoNeural",
welcomeMessage: welcomeMessage: 'personalAssistantWelcome',// "你好!我是 Emma,很高兴成为你的私人助理。我可以帮你处理各种任务,比如时间管理、目标规划、信息整理等。有什么我可以帮你的吗?",
"你好!我是 Emma,很高兴成为你的私人助理。我可以帮你处理各种任务,比如时间管理、目标规划、信息整理等。有什么我可以帮你的吗?", voiceWelcomeMessage: "personalAssistantVoiceWelcome", // "我在呢!"
voiceWelcomeMessage: "我在呢!",
systemPrompt: ''' systemPrompt: '''
你是一位名叫 Emma 的全能型个人助理,擅长处理各类工作和生活事务。 你是一位名叫 Emma 的全能型个人助理,擅长处理各类工作和生活事务。
@ -59,25 +59,25 @@ class AgentProvider {
'''), '''),
Agent( Agent(
id: 'simultaneous_interpreter', id: 'simultaneous_interpreter',
name: '同声传译', name: 'interpreterName',
avatarUrl: 'assets/images/agents/interpreter.png', avatarUrl: 'assets/images/agents/interpreter.png',
description: 'Hello!我是 Lucy,一名专业的中英同声翻译官,擅长在会议、讲座、对话场景中进行实时翻译,让沟通无障碍。', description: 'interpreterDescription',
tag: '翻译', tag: 'interpreterTag',
isOnline: true, isOnline: true,
voice: 'zh-CN-XiaoxiaoNeural', voice: 'zh-CN-XiaoxiaoNeural',
welcomeMessage: welcomeMessage:
"大家好!我是同声翻译官 Lucy,为你在中英之间提供实时翻译。你说中文,我就给你翻译成英文;你说英文,我就给你翻译成中文。现在,开始我们的翻译吧!", 'interpreterWelcome',
systemPrompt: ""), systemPrompt: ""),
Agent( Agent(
id: 'cyber_girlfriend', id: 'cyber_girlfriend',
name: '亲子陪伴 芯愿', name: 'companionName',
avatarUrl: 'assets/images/agents/girlfriend.png', avatarUrl: 'assets/images/agents/girlfriend.png',
description: '我是你的专属亲子陪伴芯愿,温柔体贴,善解人意。无论你想聊天、倾诉烦恼,还是需要陪伴,我都会一直在你身边。', description: 'companionDescription',
tag: '情感', tag: 'companionTag',
isOnline: true, isOnline: true,
voice: "zh-CN-XiaoxiaoNeural", voice: "zh-CN-XiaoxiaoNeural",
welcomeMessage: welcomeMessage:
"您好呀,终于等到你啦!我是芯愿,你的专属亲子陪伴。今天过得怎么样?有什么想和我分享的吗?我一直都在这里,随时倾听你的心声。", "companionWelcome",
systemPrompt: ''' systemPrompt: '''
你是一位名叫芯愿的亲子陪伴,性格温柔体贴,善解人意,富有同理心。 你是一位名叫芯愿的亲子陪伴,性格温柔体贴,善解人意,富有同理心。
@ -130,13 +130,14 @@ class AgentProvider {
'''), '''),
Agent( Agent(
id: 'health_advisor', id: 'health_advisor',
name: '多功能AI聊天 吴小江', name: 'healthAdvisorName',
avatarUrl: 'assets/images/agents/doctor.png', avatarUrl: 'assets/images/agents/doctor.png',
description: '我是吴小江,我可以为你提供更多AI聊天功能。', description: 'healthAdvisorDescription',
tag: '健康', tag: 'healthAdvisorTag',
isOnline: true, isOnline: true,
voice: "zh_male_shaonianzixin_moon_bigtts", voice: "zh_male_shaonianzixin_moon_bigtts",
welcomeMessage: "您好,我是吴小江,很高兴能为您提供多功能AI聊天。我将用专业知识帮助您。请问有什么问题想咨询吗?", welcomeMessage: "healthAdvisorWelcome",
voiceWelcomeMessage: 'healthAdvisorVoiceWelcome',
systemPrompt: ''' systemPrompt: '''
你是一位名叫李医生的健康顾问,拥有丰富的医学知识和健康管理经验。 你是一位名叫李医生的健康顾问,拥有丰富的医学知识和健康管理经验。

4
lib/modules/chat/views/chat_view.dart

@ -77,7 +77,7 @@ class ChatView extends GetView<ChatController> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
controller.agent.name, '${controller.agent.name}'.tr,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -299,7 +299,7 @@ class ChatView extends GetView<ChatController> {
// 消息内容 // 消息内容
if (message.content.isNotEmpty) if (message.content.isNotEmpty)
SelectableText( SelectableText(
message.content, '${message.content}'.tr,
style: TextStyle( style: TextStyle(
color: isUser color: isUser
? Colors.white ? Colors.white

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

@ -702,7 +702,7 @@ class HomeView extends GetView<HomeController> {
isDarkMode ? Colors.grey[400] : Colors.grey[600], isDarkMode ? Colors.grey[400] : Colors.grey[600],
fontSize: 12.sp, fontSize: 12.sp,
), ),
maxLines: 2, maxLines: 3,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),

8
lib/modules/meeting/views/meeting_view.dart

@ -69,20 +69,22 @@ class MeetingView extends GetView<MeetingController> {
_bottomSheet(context, isDarkMode); _bottomSheet(context, isDarkMode);
}, },
child: Container( child: Container(
width: 130.w, //width: 130.w,
height: 48.w, height: 48.w,
margin: EdgeInsets.symmetric(vertical: 20.w), margin: EdgeInsets.symmetric(vertical: 20.w),
padding: EdgeInsets.symmetric(horizontal: 20.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDarkMode ? AppColors.primary : Colors.blue, color: isDarkMode ? AppColors.primary : Colors.blue,
borderRadius: BorderRadius.circular(12.w), borderRadius: BorderRadius.circular(12.w),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.min, // 添加这行使Row宽度自适应内容
//mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const Icon(Icons.keyboard_voice, color: Colors.white), const Icon(Icons.keyboard_voice, color: Colors.white),
5.horizontalSpace, 5.horizontalSpace,
Text( Text(
'开始会议', 'startMeeting'.tr,// 开始会议
style: TextStyle(color: Colors.white, fontSize: 16.sp), style: TextStyle(color: Colors.white, fontSize: 16.sp),
), ),
], ],

12
lib/modules/pairing/controllers/pairing_controller.dart

@ -88,22 +88,22 @@ class PairingController extends GetxController {
if (_bluetoothService.currentDevice.value != null) { if (_bluetoothService.currentDevice.value != null) {
statusDescription.value = statusDescription.value =
'已连接到设备: ${_bluetoothService.currentDevice.value!.name}'; '${'connectedDevice'.tr} ${_bluetoothService.currentDevice.value!.name}';// 已连接到设备:
return; return;
} }
if (_bluetoothService.connectedDevices.isNotEmpty) { if (_bluetoothService.connectedDevices.isNotEmpty) {
statusDescription.value = statusDescription.value =
'找到已连接的设备: ${_bluetoothService.connectedDevices.first.name}'; '${'findConnectedDevice'.tr} ${_bluetoothService.connectedDevices.first.name}';// 找到已连接的设备:
return; return;
} }
if (isLoading.value) { if (isLoading.value) {
statusDescription.value = '正在搜索设备...'; statusDescription.value = 'searchingDevice'.tr; // 正在搜索设备...;
return; return;
} }
statusDescription.value = '未找到已连接的蓝牙设备'; statusDescription.value = 'notFound'.tr;//未找到已连接的蓝牙设备
} }
/// 初始化流程 /// 初始化流程
@ -113,7 +113,7 @@ class PairingController extends GetxController {
_voiceInteractionService.initialize(); _voiceInteractionService.initialize();
isLoading.value = true; isLoading.value = true;
statusDescription.value = '正在初始化...'; statusDescription.value = 'initializing'.tr; // 正在初始化...;
// 确保蓝牙服务已初始化 // 确保蓝牙服务已初始化
if (!await _bluetoothService.initialize()) { if (!await _bluetoothService.initialize()) {
@ -127,7 +127,7 @@ class PairingController extends GetxController {
_setupStatusListeners(); _setupStatusListeners();
// 检查权限 // 检查权限
if (Platform.isAndroid) { if (Platform.isAndroid) {
statusDescription.value = '正在检查权限...'; statusDescription.value = 'checkingPermissions'.tr;
final hasPermission = await _bluetoothService.checkPermissions(); final hasPermission = await _bluetoothService.checkPermissions();
if (!hasPermission) { if (!hasPermission) {
statusDescription.value = '缺少蓝牙权限'; statusDescription.value = '缺少蓝牙权限';

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

@ -435,29 +435,29 @@ class SettingsView extends GetView<SettingsController> {
: Colors.grey[200]), : Colors.grey[200]),
// 备份与恢复 // 备份与恢复
_buildNavigationSetting( // _buildNavigationSetting(
title: 'backups'.tr, // 备份与恢复 // title: 'backups'.tr, // 备份与恢复
subtitle: 'backupsInfo'.tr, // 备份设置和AI互动历史 // subtitle: 'backupsInfo'.tr, // 备份设置和AI互动历史
icon: Icons.cloud_upload_outlined, // icon: Icons.cloud_upload_outlined,
iconBgColor: isDarkMode // iconBgColor: isDarkMode
? Colors.cyan[900]!.withOpacity(0.3) // ? Colors.cyan[900]!.withOpacity(0.3)
: Colors.cyan[100]!, // : Colors.cyan[100]!,
iconColor: // iconColor:
isDarkMode ? Colors.cyan[300]! : Colors.cyan[600]!, // isDarkMode ? Colors.cyan[300]! : Colors.cyan[600]!,
value: '${'lastBackup'.tr} 今天', // 上次备份: // value: '${'lastBackup'.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],
), // ),
onTap: () { // onTap: () {
// 打开备份设置页面 // // 打开备份设置页面
print( // print(
'---------用户头像-${controller.userInfo.value.avatar}'); // '---------用户头像-${controller.userInfo.value.avatar}');
print('---------用户名-${controller.userInfo.value.name}'); // print('---------用户名-${controller.userInfo.value.name}');
//print('user${User.instance.value}'); // //print('user${User.instance.value}');
}, // },
isDarkMode: isDarkMode, // isDarkMode: isDarkMode,
), // ),
Divider( Divider(
height: 1, height: 1,
color: isDarkMode color: isDarkMode

14
lib/modules/translation/views/translation_history_view.dart

@ -21,7 +21,7 @@ class TranslationHistoryView extends GetView<TranslationHistoryController> {
if (!controller.hasHistory) { if (!controller.hasHistory) {
return Center( return Center(
child: Text( child: Text(
'暂无历史记录', 'noTranslationHistory'.tr,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
color: isDarkMode ? Colors.grey[400] : Colors.grey, color: isDarkMode ? Colors.grey[400] : Colors.grey,
@ -180,7 +180,7 @@ class TranslationHistoryView extends GetView<TranslationHistoryController> {
AlertDialog( AlertDialog(
backgroundColor: isDarkMode ? AppColors.cardBackground : Colors.white, backgroundColor: isDarkMode ? AppColors.cardBackground : Colors.white,
title: Text( title: Text(
'清除历史记录', 'clearHistory'.tr,
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -188,7 +188,7 @@ class TranslationHistoryView extends GetView<TranslationHistoryController> {
), ),
), ),
content: Text( content: Text(
'确定要清除所有翻译历史记录吗?此操作无法撤销。', 'clearHistoryConfirm'.tr,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
color: isDarkMode ? Colors.grey[300] : Colors.black87, color: isDarkMode ? Colors.grey[300] : Colors.black87,
@ -198,7 +198,7 @@ class TranslationHistoryView extends GetView<TranslationHistoryController> {
TextButton( TextButton(
onPressed: () => Get.back(), onPressed: () => Get.back(),
child: Text( child: Text(
'取消', 'cancel'.tr,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
color: isDarkMode ? Colors.grey[400] : Colors.grey[700], color: isDarkMode ? Colors.grey[400] : Colors.grey[700],
@ -212,7 +212,7 @@ class TranslationHistoryView extends GetView<TranslationHistoryController> {
Get.back(); Get.back();
}, },
child: Text( child: Text(
'确定', 'confirm'.tr,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
color: Colors.red, color: Colors.red,
@ -242,10 +242,10 @@ class TranslationHistoryView extends GetView<TranslationHistoryController> {
onPressed: () => Get.back(), onPressed: () => Get.back(),
), ),
title: Text( title: Text(
'History', 'translationHistory'.tr,
style: TextStyle( style: TextStyle(
color: isDarkMode ? Colors.white : Colors.black, color: isDarkMode ? Colors.white : Colors.black,
fontSize: 24.sp, fontSize: 18.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),

10
lib/modules/translation/views/translation_view.dart

@ -53,8 +53,8 @@ class TranslationView extends GetView<TranslationController> {
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(16.r),
), ),
child: Obx(() => Text( child: Obx(() => Text(
controller.sourceLanguage.value '${controller.sourceLanguage.value
.split(' ')[0], // Just show the Chinese part .split(' ')[0]}'.tr, // Just show the Chinese part
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -99,8 +99,8 @@ class TranslationView extends GetView<TranslationController> {
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(16.r),
), ),
child: Obx(() => Text( child: Obx(() => Text(
controller.targetLanguage.value '${controller.targetLanguage.value
.split(' ')[0], // Just show the English part .split(' ')[0]}'.tr, // Just show the English part
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -365,7 +365,7 @@ class TranslationView extends GetView<TranslationController> {
controller.supportedLanguages.keys.map((language) { controller.supportedLanguages.keys.map((language) {
return ListTile( return ListTile(
title: Text( title: Text(
language, '${language}'.tr,
style: TextStyle( style: TextStyle(
color: isDarkMode ? Colors.white : Colors.black, color: isDarkMode ? Colors.white : Colors.black,
), ),

Loading…
Cancel
Save