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

@@ -116,11 +116,12 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
}
Widget _buildUpgradeContent() {
final l10n = AppLocalizations.of(context);
return ListView(
padding: EdgeInsets.zero,
children: [
Text(
'软件升级',
l10n?.upgrade ?? '软件升级',
style: TextStyle(
color: AppTheme.textPrimary,
fontSize: 18,
@@ -139,7 +140,7 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
Icon(Icons.info_outline, color: AppTheme.primaryColor),
const SizedBox(width: 12),
Text(
'当前版本: $_currentVersion',
'${l10n?.currentVersion ?? '当前版本'}: $_currentVersion',
style: TextStyle(color: AppTheme.textPrimary),
),
],
@@ -147,13 +148,13 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
),
const SizedBox(height: 24),
CommonButton(
text: '检查更新',
text: l10n?.checkUpdate ?? '检查更新',
icon: Icons.refresh,
type: ButtonType.primary,
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('已是最新版本'),
content: Text(l10n?.latestVersion ?? '已是最新版本'),
backgroundColor: AppTheme.successColor,
),
);