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:
116
lib/l10n/app_localizations_en.dart
Normal file
116
lib/l10n/app_localizations_en.dart
Normal file
@@ -0,0 +1,116 @@
|
||||
// ignore: unused_import
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
import 'app_localizations.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
/// The translations for English (`en`).
|
||||
class AppLocalizationsEn extends AppLocalizations {
|
||||
AppLocalizationsEn([String locale = 'en']) : super(locale);
|
||||
|
||||
@override
|
||||
String get appTitle => 'BadNote';
|
||||
|
||||
@override
|
||||
String get settings => 'Settings';
|
||||
|
||||
@override
|
||||
String get search => 'Search';
|
||||
|
||||
@override
|
||||
String get importPdf => 'Import PDF';
|
||||
|
||||
@override
|
||||
String get importPpt => 'Import PPT';
|
||||
|
||||
@override
|
||||
String get penCanvasBeta => 'Pen Canvas (beta)';
|
||||
|
||||
@override
|
||||
String get newNote => 'New Note';
|
||||
|
||||
@override
|
||||
String get open => 'Open';
|
||||
|
||||
@override
|
||||
String get cancel => 'Cancel';
|
||||
|
||||
@override
|
||||
String get delete => 'Delete';
|
||||
|
||||
@override
|
||||
String get deleteNoteTitle => 'Delete note?';
|
||||
|
||||
@override
|
||||
String get deleteNote => 'Delete note';
|
||||
|
||||
@override
|
||||
String get openInSplitView => 'Open in Split View';
|
||||
|
||||
@override
|
||||
String get splitViewSubtitle => 'PDF reference + scratchpad';
|
||||
|
||||
@override
|
||||
String get removeDocument => 'Remove document';
|
||||
|
||||
@override
|
||||
String get processingPptx => 'Processing PPTX...';
|
||||
|
||||
@override
|
||||
String get processingPresentation => 'Processing presentation...';
|
||||
|
||||
@override
|
||||
String get couldNotOpenPresentation => 'Could not open presentation.';
|
||||
|
||||
@override
|
||||
String get toolPen => 'Pen';
|
||||
|
||||
@override
|
||||
String get toolHighlighter => 'Highlighter';
|
||||
|
||||
@override
|
||||
String get toolEraser => 'Eraser';
|
||||
|
||||
@override
|
||||
String get actionUndo => 'Undo';
|
||||
|
||||
@override
|
||||
String get actionRedo => 'Redo';
|
||||
|
||||
@override
|
||||
String get fingerDrawingOn => 'Finger drawing ON';
|
||||
|
||||
@override
|
||||
String get fingerDrawingOff => 'Finger drawing OFF (pen only)';
|
||||
|
||||
@override
|
||||
String get pages => 'Pages';
|
||||
|
||||
@override
|
||||
String get penSettings => 'Pen settings';
|
||||
|
||||
@override
|
||||
String get inputDiagnostic => 'Input diagnostic (writes a log file)';
|
||||
|
||||
@override
|
||||
String get back => 'Back';
|
||||
|
||||
@override
|
||||
String get previousPage => 'Previous page';
|
||||
|
||||
@override
|
||||
String get nextPage => 'Next page';
|
||||
|
||||
@override
|
||||
String failedToOpenPdf(String error) {
|
||||
return 'Failed to open PDF:\n$error';
|
||||
}
|
||||
|
||||
@override
|
||||
String get pdfNoPages => 'PDF has no pages.';
|
||||
|
||||
@override
|
||||
String pageOfPages(int current, int total) {
|
||||
return '$current / $total';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user