|
|
|
@ -102,7 +102,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
children: [ |
|
|
|
Expanded( |
|
|
|
child: Obx(() => _buildTabButton( |
|
|
|
title: '原始记录', |
|
|
|
title: 'originalRecord'.tr, // 原始记录 |
|
|
|
isSelected: controller.selectedTabIndex.value == 0, |
|
|
|
onTap: () => controller.switchTab(0), |
|
|
|
isDarkMode: isDarkMode, |
|
|
|
@ -112,7 +112,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
// SizedBox(width: 12.w), |
|
|
|
// Expanded( |
|
|
|
// child: Obx(() => _buildTabButton( |
|
|
|
// title: '记录摘要', |
|
|
|
// title: 'recordSummary'.tr, // 记录摘要 |
|
|
|
// isSelected: controller.selectedTabIndex.value == 1, |
|
|
|
// onTap: () => controller.switchTab(1), |
|
|
|
// isDarkMode: isDarkMode, |
|
|
|
@ -361,7 +361,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
padding: EdgeInsets.all(24.r), |
|
|
|
child: Center( |
|
|
|
child: Text( |
|
|
|
'点击下方按钮生成会话摘要', |
|
|
|
'clickToGenerateSummary'.tr, // 点击下方按钮生成会话摘要 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 15.sp, |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[600], |
|
|
|
@ -384,7 +384,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
'摘要内容', |
|
|
|
'summaryContent'.tr, // 摘要内容 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
@ -459,8 +459,8 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
void _copySummaryToClipboard() { |
|
|
|
Clipboard.setData(ClipboardData(text: controller.summaryResult.value)); |
|
|
|
Get.snackbar( |
|
|
|
'已复制', |
|
|
|
'摘要已复制到剪贴板', |
|
|
|
'copied'.tr, // 已复制 |
|
|
|
'summaryCopiledToClipboard'.tr, // 摘要已复制到剪贴板 |
|
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
|
duration: Duration(seconds: 2), |
|
|
|
); |
|
|
|
@ -490,7 +490,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
child: controller.isGeneratingSummary.value |
|
|
|
? _buildGeneratingIndicator(isDarkMode) |
|
|
|
: Text( |
|
|
|
controller.summaryResult.value.isEmpty ? '提取摘要' : '已生成摘要', |
|
|
|
controller.summaryResult.value.isEmpty ? 'extractSummary'.tr : 'summaryGenerated'.tr, // 提取摘要 : 已生成摘要 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
@ -515,7 +515,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
), |
|
|
|
SizedBox(width: 12.w), |
|
|
|
Text( |
|
|
|
'生成中...', |
|
|
|
'generating'.tr, // 生成中... |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
@ -545,7 +545,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
), |
|
|
|
), |
|
|
|
child: Text( |
|
|
|
'重新生成', |
|
|
|
'regenerate'.tr, // 重新生成 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
@ -570,14 +570,14 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
Get.dialog( |
|
|
|
AlertDialog( |
|
|
|
title: Text( |
|
|
|
'请求超时', |
|
|
|
'requestTimeout'.tr, // 请求超时 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 18.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
), |
|
|
|
), |
|
|
|
content: Text( |
|
|
|
'生成摘要请求超时,可能是网络问题或服务器繁忙。', |
|
|
|
'summaryTimeoutMessage'.tr, // 生成摘要请求超时,可能是网络问题或服务器繁忙。 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
), |
|
|
|
@ -586,7 +586,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
TextButton( |
|
|
|
onPressed: () => Get.back(), |
|
|
|
child: Text( |
|
|
|
'取消', |
|
|
|
'cancel'.tr, // 取消 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
color: Colors.grey[700], |
|
|
|
@ -600,7 +600,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
controller.retryExtractSummaryWithExtendedTimeout(text); |
|
|
|
}, |
|
|
|
child: Text( |
|
|
|
'重试', |
|
|
|
'retry'.tr, // 重试 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
color: Colors.blue, |
|
|
|
@ -624,7 +624,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
AlertDialog( |
|
|
|
backgroundColor: isDarkMode ? AppColors.cardBackground : Colors.white, |
|
|
|
title: Text( |
|
|
|
'删除翻译记录', |
|
|
|
'deleteTranslationRecord'.tr, // 删除翻译记录 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 18.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
@ -636,7 +636,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
'确定要删除这条翻译记录吗?此操作无法撤销。', |
|
|
|
'deleteTranslationConfirm'.tr, // 确定要删除这条翻译记录吗?此操作无法撤销。 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
color: isDarkMode ? Colors.grey[300] : Colors.black87, |
|
|
|
@ -720,15 +720,15 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
// 分享原始记录 |
|
|
|
final String sourceText = _getCombinedSourceText(); |
|
|
|
final String translatedText = _getCombinedTranslatedText(); |
|
|
|
shareText = '原文:\n$sourceText\n\n译文:\n$translatedText'; |
|
|
|
shareText = '${'originalText'.tr}:\n$sourceText\n\n${'translatedText'.tr}:\n$translatedText'; // 原文:译文: |
|
|
|
} else { |
|
|
|
// 分享摘要 |
|
|
|
if (controller.summaryResult.value.isNotEmpty) { |
|
|
|
shareText = '会话摘要:\n${controller.summaryResult.value}'; |
|
|
|
shareText = '${'sessionSummary'.tr}:\n${controller.summaryResult.value}'; // 会话摘要: |
|
|
|
} else { |
|
|
|
Get.snackbar( |
|
|
|
'无法分享', |
|
|
|
'请先生成摘要', |
|
|
|
'cannotShare'.tr, // 无法分享 |
|
|
|
'generateSummaryFirst'.tr, // 请先生成摘要 |
|
|
|
snackPosition: SnackPosition.BOTTOM, |
|
|
|
duration: Duration(seconds: 2), |
|
|
|
); |
|
|
|
@ -739,7 +739,7 @@ class TranslationDetailView extends GetView<TranslationDetailController> { |
|
|
|
// 调用系统分享 |
|
|
|
Share.share( |
|
|
|
shareText, |
|
|
|
subject: '翻译会话记录 - ${DateFormat('yyyy-MM-dd HH:mm').format(controller.currentItem.timestamp)}', |
|
|
|
subject: '${'translationSessionRecord'.tr} - ${DateFormat('yyyy-MM-dd HH:mm').format(controller.currentItem.timestamp)}', // 翻译会话记录 |
|
|
|
); |
|
|
|
} |
|
|
|
} |