feat(i18n): add English + Chinese localization
All checks were successful
CI / Windows build (push) Successful in 12m34s
All checks were successful
CI / Windows build (push) Successful in 12m34s
The app had zero localization ("软件多语言做了吗" — no). Add Flutter's
official gen-l10n pipeline and localize the core flow the user sees.
- pubspec: flutter_localizations + intl + generate: true
- l10n.yaml + lib/l10n/app_en.arb + app_zh.arb (37 strings)
- main.dart: localizationsDelegates + supportedLocales (follows OS locale)
- pen editor: all tool tooltips, page pill, error states localized
- home: app bar actions + empty-state buttons localized
Proven end-to-end: l10n_test pumps the same widget under Locale('en')
and Locale('zh') and asserts English vs Chinese strings resolve.
flutter analyze: 0 issues. l10n_test: 3/3 pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
37
lib/l10n/app_zh.arb
Normal file
37
lib/l10n/app_zh.arb
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"@@locale": "zh",
|
||||
"appTitle": "BadNote",
|
||||
"settings": "设置",
|
||||
"search": "搜索",
|
||||
"importPdf": "导入 PDF",
|
||||
"importPpt": "导入 PPT",
|
||||
"penCanvasBeta": "手写画布(测试版)",
|
||||
"newNote": "新建笔记",
|
||||
"open": "打开",
|
||||
"cancel": "取消",
|
||||
"delete": "删除",
|
||||
"deleteNoteTitle": "删除笔记?",
|
||||
"deleteNote": "删除笔记",
|
||||
"openInSplitView": "分屏打开",
|
||||
"splitViewSubtitle": "PDF 参考 + 草稿纸",
|
||||
"removeDocument": "移除文档",
|
||||
"processingPptx": "正在处理 PPTX…",
|
||||
"processingPresentation": "正在处理演示文稿…",
|
||||
"couldNotOpenPresentation": "无法打开演示文稿。",
|
||||
"toolPen": "钢笔",
|
||||
"toolHighlighter": "荧光笔",
|
||||
"toolEraser": "橡皮擦",
|
||||
"actionUndo": "撤销",
|
||||
"actionRedo": "重做",
|
||||
"fingerDrawingOn": "手指书写:开",
|
||||
"fingerDrawingOff": "手指书写:关(仅手写笔)",
|
||||
"pages": "页面",
|
||||
"penSettings": "手写笔设置",
|
||||
"inputDiagnostic": "输入诊断(写入日志文件)",
|
||||
"back": "返回",
|
||||
"previousPage": "上一页",
|
||||
"nextPage": "下一页",
|
||||
"failedToOpenPdf": "打开 PDF 失败:\n{error}",
|
||||
"pdfNoPages": "PDF 没有任何页面。",
|
||||
"pageOfPages": "{current} / {total}"
|
||||
}
|
||||
Reference in New Issue
Block a user