feat: write the UI in English, select only conversation content
- source strings are English again; Chinese comes from lib/l10n/zh.dart through tr()/trArgs() and AppText, and a language without a table (Spanish, ...) reads English instead of Chinese - server and user data (titles, messages, file names, notes, task names) is drawn with plain Text, so it is never looked up in the table - SelectionArea moved from the whole message list to the messages, the answer text, an opened tool call's details and the turn footer; status lines and folded tool rows no longer start a selection - a message the transcript does not know (its start event was lost while the stream was down) fetches the tail once, so a turn continued from another client comes in with its prompt - bump to 0.5.3
This commit is contained in:
1 parent
7b5bccf28f
commit
511c3b006b
43 files changed
+1620
-1791
No files matched your search
@@ -111,16 +111,16 @@ class PetLibrary extends ChangeNotifier {
|
||||
/// Unpacks and activates a pet package. [root] is for tests; the app uses
|
||||
/// the documents directory.
|
||||
Future<PetPack> importZip(List<int> bytes, {Directory? root}) async {
|
||||
if (bytes.isEmpty) throw PetImportException(tr('文件为空'));
|
||||
if (bytes.isEmpty) throw PetImportException(tr('File is empty'));
|
||||
if (bytes.length > 40 * 1024 * 1024) {
|
||||
throw PetImportException(tr('宠物包不能超过 40MB'));
|
||||
throw PetImportException(tr('Pet pack cannot exceed 40 MB'));
|
||||
}
|
||||
|
||||
final Archive archive;
|
||||
try {
|
||||
archive = ZipDecoder().decodeBytes(bytes, verify: true);
|
||||
} catch (_) {
|
||||
throw PetImportException(tr('不是有效的 zip 文件'));
|
||||
throw PetImportException(tr('Not a valid zip file'));
|
||||
}
|
||||
|
||||
ArchiveFile? manifest;
|
||||
@@ -134,7 +134,7 @@ class PetLibrary extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
if (manifest == null) {
|
||||
throw PetImportException(tr('压缩包里没有 pack.json'));
|
||||
throw PetImportException(tr('The archive has no pack.json'));
|
||||
}
|
||||
|
||||
final manifestName = manifest.name.replaceAll('\\', '/');
|
||||
@@ -149,10 +149,10 @@ class PetLibrary extends ChangeNotifier {
|
||||
if (json is! Map<String, dynamic>) throw const FormatException();
|
||||
parsed = PetPack.fromJson(json);
|
||||
} catch (_) {
|
||||
throw PetImportException(tr('pack.json 不是有效的宠物包'));
|
||||
throw PetImportException(tr('pack.json is not a valid pet pack'));
|
||||
}
|
||||
if (!parsed.isValid) {
|
||||
throw PetImportException(tr('pack.json 缺少动画或状态'));
|
||||
throw PetImportException(tr('pack.json is missing animations or states'));
|
||||
}
|
||||
|
||||
final id = _safeId(parsed.id.isNotEmpty ? parsed.id : parsed.name);
|
||||
@@ -175,7 +175,7 @@ class PetLibrary extends ChangeNotifier {
|
||||
final content = _content(file);
|
||||
extracted += content.length;
|
||||
if (extracted > 60 * 1024 * 1024) {
|
||||
throw PetImportException(tr('解压后超过 60MB'));
|
||||
throw PetImportException(tr('Extracted size exceeds 60 MB'));
|
||||
}
|
||||
final target = File('${staging.path}/$rel');
|
||||
await target.parent.create(recursive: true);
|
||||
@@ -184,11 +184,11 @@ class PetLibrary extends ChangeNotifier {
|
||||
|
||||
for (final animation in parsed.animations.values) {
|
||||
if (animation.sheet.isEmpty) {
|
||||
throw PetImportException(trArgs('动画 {0} 没有精灵图', [animation.name]));
|
||||
throw PetImportException(trArgs('Animation {0} has no sprite sheet', [animation.name]));
|
||||
}
|
||||
final sheet = File('${staging.path}/${animation.sheet}');
|
||||
if (!await sheet.exists()) {
|
||||
throw PetImportException(trArgs('缺少精灵图 {0}', [animation.sheet]));
|
||||
throw PetImportException(trArgs('Missing sprite sheet {0}', [animation.sheet]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user