feat(i18n): 完成全量 UI 文本国际化,替换所有硬编码中文为 AppLocalizations 调用

- core/localization: 新增约 60 个翻译键(含参数化方法),中英双语覆盖
- shared/widgets: CommonDialog 默认参数国际化
- features/home: 完成页操作步骤指引、状态栏串口连接状态、程序列表状态标签
- features/programs: 表头状态列、表单验证提示、导入/模板操作反馈、删除确认(参数化)
- features/program_detail: 步骤列表/表单标题、删除确认、速度档位显示(参数化)
- features/device: run_state_provider 错误消息改为错误码
- features/settings: 升级页、密码面板、语言面板、U盘导入面板、串口配置面板全部替换

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Developer
2026-06-12 15:09:47 +08:00
parent 5d65744618
commit 3d849bd468
23 changed files with 688 additions and 127 deletions

View File

@@ -53,7 +53,7 @@ class _StepListState extends State<StepList> {
Icon(Icons.list, color: AppTheme.primaryColor, size: 20),
const SizedBox(width: 12),
Text(
'步骤列表',
l10n?.stepList ?? '步骤列表',
style: TextStyle(
color: AppTheme.primaryColor,
fontWeight: FontWeight.w600,
@@ -61,7 +61,7 @@ class _StepListState extends State<StepList> {
),
const Spacer(),
Text(
'${widget.steps.length}',
l10n?.stepsCountLabel(widget.steps.length) ?? '${widget.steps.length}',
style: TextStyle(
color: AppTheme.textSecondary,
fontSize: 12,
@@ -114,7 +114,7 @@ class _StepListState extends State<StepList> {
children: [
Icon(Icons.add_circle_outline, size: 48, color: AppTheme.idleColor),
const SizedBox(height: 12),
Text('暂无步骤', style: TextStyle(color: AppTheme.textSecondary)),
Text(l10n?.noSteps ?? '暂无步骤', style: TextStyle(color: AppTheme.textSecondary)),
],
),
)
@@ -149,7 +149,7 @@ class _StepListState extends State<StepList> {
children: [
// 添加按钮
CommonButton(
text: '添加',
text: l10n?.add ?? '添加',
icon: Icons.add,
type: ButtonType.primary,
onPressed: widget.onAddStep,
@@ -158,7 +158,7 @@ class _StepListState extends State<StepList> {
// 删除按钮
if (_selectedIds.isNotEmpty)
CommonButton(
text: '删除',
text: l10n?.delete ?? '删除',
icon: Icons.delete,
type: ButtonType.danger,
onPressed: () => _showDeleteConfirmDialog(context),
@@ -241,8 +241,8 @@ class _StepListState extends State<StepList> {
title: Text(l10n?.confirm ?? '确认'),
content: Text(
_selectedIds.length == 1
? '确定要删除此步骤吗?'
: '确定要删除选中的 ${_selectedIds.length} 个步骤吗?',
? l10n?.deleteStepConfirmSingle ?? '确定要删除此步骤吗?'
: l10n?.deleteStepConfirmMultiple(_selectedIds.length) ?? '确定要删除选中的 ${_selectedIds.length} 个步骤吗?',
),
actions: [
TextButton(