feat: English and Chinese, and selectable chat text

- settings → general → language picks system, Chinese or English; the
  choice is stored on the device and read before the first frame
- our Chinese strings are translated through tr()/trArgs() and AppText,
  with the English in lib/l10n/en_*.dart; a missing entry falls back to
  Chinese and a test checks that every literal in lib has one
- AppText rebuilds on a language change (it depends on the resolved
  locale), so const text and whole pages switch at once; the built-in
  date/time pickers and selection menu follow the same language
- server and user data (titles, messages, prompts, paths) is never
  translated
- the chat list sits in a SelectionArea: long-press selects message text
  and shows the copy/select-all menu
- bump to 0.5.2
This commit is contained in:
blumia committed 2026-11-26 09:04:25 +08:00
1 parent da4bfb6826
commit 7b5bccf28f
42 files changed
+1943 -735

No files matched your search

+6 -5
View File
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import '../state.dart';
import 'scheduled_tasks_screen.dart';
import '../l10n.dart';
class FeaturesScreen extends StatelessWidget {
final AppState app;
@@ -13,11 +14,11 @@ class FeaturesScreen extends StatelessWidget {
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(title: const Text('全部功能')),
appBar: AppBar(title: const AppText('全部功能')),
body: ListView(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 32),
children: [
Text('服务器与智能体的工具都收在这里。',
AppText('服务器与智能体的工具都收在这里。',
style: TextStyle(fontSize: 12.5, color: theme.hintColor)),
const SizedBox(height: 14),
GridView.count(
@@ -82,11 +83,11 @@ class _FeatureTile extends StatelessWidget {
size: 21, color: theme.colorScheme.onPrimaryContainer),
),
const Spacer(),
Text(title,
AppText(title,
style: const TextStyle(
fontSize: 14.5, fontWeight: FontWeight.w600)),
const SizedBox(height: 2),
Text(
AppText(
caption,
maxLines: 2,
overflow: TextOverflow.ellipsis,
@@ -98,4 +99,4 @@ class _FeatureTile extends StatelessWidget {
),
);
}
}
}