translate notifications.

This commit is contained in:
ericz
2026-05-10 11:09:25 +02:00
parent e92a66ff28
commit d2a6fbe182
2 changed files with 79 additions and 22 deletions
+1 -1
View File
@@ -454,7 +454,7 @@ class TranslationService extends ChangeNotifier {
final targetLabel = _languageLabel(targetLanguageCode);
final instruction = targetLanguageCode == 'zh'
? '将以下文本翻译为中文,注意只需要输出翻译后的结果,不要额外解释:\n\n$text'
: 'Translate the following segment into $targetLabel, without additional explanation.\n\n$text';
: 'Translate the following segment into $targetLabel, without additional explanation. If it is already in $targetLabel, then return the exact same String.\n\n$text';
try {
return await _runExclusive(() async {
final engine = await _ensureContext(model.localPath);