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
@@ -166,57 +166,57 @@ class ScheduledTask {
|
||||
|
||||
/// The model line: a fixed choice, or that the run uses the session's.
|
||||
String get modelLabel {
|
||||
if (useDefaults || modelId.isEmpty) return tr('使用默认模型与智能体');
|
||||
if (useDefaults || modelId.isEmpty) return tr('Use default model and agent');
|
||||
final model = [providerId, modelId].where((s) => s.isNotEmpty).join('/');
|
||||
return agent.isEmpty ? model : '$model · $agent';
|
||||
}
|
||||
}
|
||||
|
||||
const scheduledWeekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
const scheduledWeekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
||||
|
||||
const scheduledTaskKindLabels = {
|
||||
'daily': '每天',
|
||||
'weekly': '每周',
|
||||
'once': '一次性',
|
||||
'daily': 'Daily',
|
||||
'weekly': 'Weekly',
|
||||
'once': 'Once',
|
||||
'cron': 'Cron',
|
||||
};
|
||||
|
||||
/// '每天 09:00', '每周 周一、周三 09:00', '一次性 2026-12-01 09:00', …
|
||||
String scheduledScheduleText(ScheduledTask task) {
|
||||
final separator = tr('、');
|
||||
final separator = tr(', ');
|
||||
final times = task.times.isEmpty ? task.time : task.times.join(separator);
|
||||
switch (task.kind) {
|
||||
case 'daily':
|
||||
return trArgs('每天 {0}', [times.isEmpty ? '--:--' : times]);
|
||||
return trArgs('Daily {0}', [times.isEmpty ? '--:--' : times]);
|
||||
case 'weekly':
|
||||
final days = [
|
||||
for (final day in task.weekdays)
|
||||
if (day >= 0 && day < scheduledWeekdays.length)
|
||||
tr(scheduledWeekdays[day]),
|
||||
].join(separator);
|
||||
return trArgs('每周 {0} {1}', [
|
||||
days.isEmpty ? tr('未选') : days,
|
||||
return trArgs('Weekly {0} {1}', [
|
||||
days.isEmpty ? tr('no days') : days,
|
||||
times.isEmpty ? '--:--' : times,
|
||||
]);
|
||||
case 'once':
|
||||
return trArgs('一次性 {0} {1}', [
|
||||
task.date.isEmpty ? tr('未选日期') : task.date,
|
||||
return trArgs('Once {0} {1}', [
|
||||
task.date.isEmpty ? tr('no date') : task.date,
|
||||
task.time.isEmpty ? '--:--' : task.time,
|
||||
]);
|
||||
case 'cron':
|
||||
return trArgs('Cron:{0}', [task.cron]);
|
||||
return trArgs('Cron: {0}', [task.cron]);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
String scheduledStatusLabel(String status) => switch (status) {
|
||||
'success' || 'sent' => tr('成功'),
|
||||
'error' || 'failed' => tr('错误'),
|
||||
'running' => tr('运行中'),
|
||||
'queued' => tr('已排队'),
|
||||
'skipped' => tr('已跳过'),
|
||||
'cancelled' => tr('已取消'),
|
||||
_ => tr('空闲'),
|
||||
'success' || 'sent' => tr('Success'),
|
||||
'error' || 'failed' => tr('Error'),
|
||||
'running' => tr('Running'),
|
||||
'queued' => tr('Queued'),
|
||||
'skipped' => tr('Skipped'),
|
||||
'cancelled' => tr('Cancelled'),
|
||||
_ => tr('Idle'),
|
||||
};
|
||||
|
||||
/// How far away a moment is, in the words the web client uses.
|
||||
@@ -228,24 +228,24 @@ String scheduledRelativeTime(int milliseconds) {
|
||||
const hour = 60 * minute;
|
||||
const day = 24 * hour;
|
||||
final future = diff >= 0;
|
||||
if (abs < minute) return future ? tr('不到 1 分钟后') : tr('刚刚');
|
||||
if (abs < minute) return future ? tr('In less than a minute') : tr('Just now');
|
||||
if (abs < hour) {
|
||||
final m = (abs / minute).round();
|
||||
return future
|
||||
? trArgs('{0} 分钟后', [m])
|
||||
: trArgs('{0} 分钟前', [m]);
|
||||
? trArgs('In {0} min', [m])
|
||||
: trArgs('{0} min ago', [m]);
|
||||
}
|
||||
if (abs < day) {
|
||||
final h = abs ~/ hour;
|
||||
final m = ((abs % hour) / minute).round();
|
||||
final body =
|
||||
m > 0 ? trArgs('{0} 小时 {1} 分钟', [h, m]) : trArgs('{0} 小时', [h]);
|
||||
return future ? trArgs('{0}后', [body]) : trArgs('{0}前', [body]);
|
||||
m > 0 ? trArgs('{0} hr {1} min', [h, m]) : trArgs('{0} hr', [h]);
|
||||
return future ? trArgs('In {0}', [body]) : trArgs('{0} ago', [body]);
|
||||
}
|
||||
final d = abs ~/ day;
|
||||
final h = ((abs % day) / hour).round();
|
||||
final body = h > 0 ? trArgs('{0} 天 {1} 小时', [d, h]) : trArgs('{0} 天', [d]);
|
||||
return future ? trArgs('{0}后', [body]) : trArgs('{0}前', [body]);
|
||||
final body = h > 0 ? trArgs('{0} days {1} hr', [d, h]) : trArgs('{0} days', [d]);
|
||||
return future ? trArgs('In {0}', [body]) : trArgs('{0} ago', [body]);
|
||||
}
|
||||
|
||||
String scheduledClock(int milliseconds) {
|
||||
|
||||
Reference in new issue
Block a user