Files
BadNote/lib/l10n/app_localizations.dart
Akiba So f757701391
All checks were successful
CI / Windows build (push) Successful in 20m32s
feat(board): sticky-note board with backlinks
Wire the F7 双链 + 无限便利贴 model (Board/LinkGraph) into a
reachable screen. Previously the model existed but had no UI and
no entry point.

board_screen.dart: an infinite InteractiveViewer canvas of
draggable, editable sticky cards. Card text renders [[links]] as
tappable chips that pan to the target card (dangling links styled
apart). A backlinks panel lists "linked from" via backlinksOf.
"Add card" FAB drops a card at the viewport center.

Persistence: a board_cards table (DB v7), one row per card,
debounced 800ms like the ink editors, loaded on open — boards
survive restart. Entry added to the home screen app bar
(dashboard_customize icon).

Ink-on-cards, multi-board management and link autocomplete are
deferred (TODO board-ink / board-multi / board-link-autocomplete).
analyze clean, 285 tests green.
2026-06-24 17:15:39 +08:00

543 lines
14 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:intl/intl.dart' as intl;
import 'app_localizations_en.dart';
import 'app_localizations_zh.dart';
// ignore_for_file: type=lint
/// Callers can lookup localized strings with an instance of AppLocalizations
/// returned by `AppLocalizations.of(context)`.
///
/// Applications need to include `AppLocalizations.delegate()` in their app's
/// `localizationDelegates` list, and the locales they support in the app's
/// `supportedLocales` list. For example:
///
/// ```dart
/// import 'l10n/app_localizations.dart';
///
/// return MaterialApp(
/// localizationsDelegates: AppLocalizations.localizationsDelegates,
/// supportedLocales: AppLocalizations.supportedLocales,
/// home: MyApplicationHome(),
/// );
/// ```
///
/// ## Update pubspec.yaml
///
/// Please make sure to update your pubspec.yaml to include the following
/// packages:
///
/// ```yaml
/// dependencies:
/// # Internationalization support.
/// flutter_localizations:
/// sdk: flutter
/// intl: any # Use the pinned version from flutter_localizations
///
/// # Rest of dependencies
/// ```
///
/// ## iOS Applications
///
/// iOS applications define key application metadata, including supported
/// locales, in an Info.plist file that is built into the application bundle.
/// To configure the locales supported by your app, youll need to edit this
/// file.
///
/// First, open your projects ios/Runner.xcworkspace Xcode workspace file.
/// Then, in the Project Navigator, open the Info.plist file under the Runner
/// projects Runner folder.
///
/// Next, select the Information Property List item, select Add Item from the
/// Editor menu, then select Localizations from the pop-up menu.
///
/// Select and expand the newly-created Localizations item then, for each
/// locale your application supports, add a new item and select the locale
/// you wish to add from the pop-up menu in the Value field. This list should
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
/// property.
abstract class AppLocalizations {
AppLocalizations(String locale)
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
final String localeName;
static AppLocalizations of(BuildContext context) {
return Localizations.of<AppLocalizations>(context, AppLocalizations)!;
}
static const LocalizationsDelegate<AppLocalizations> delegate =
_AppLocalizationsDelegate();
/// A list of this localizations delegate along with the default localizations
/// delegates.
///
/// Returns a list of localizations delegates containing this delegate along with
/// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
/// and GlobalWidgetsLocalizations.delegate.
///
/// Additional delegates can be added by appending to this list in
/// MaterialApp. This list does not have to be used at all if a custom list
/// of delegates is preferred or required.
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
<LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
];
/// A list of this localizations delegate's supported locales.
static const List<Locale> supportedLocales = <Locale>[
Locale('en'),
Locale('zh'),
];
/// No description provided for @appTitle.
///
/// In en, this message translates to:
/// **'BadNote'**
String get appTitle;
/// No description provided for @settings.
///
/// In en, this message translates to:
/// **'Settings'**
String get settings;
/// No description provided for @search.
///
/// In en, this message translates to:
/// **'Search'**
String get search;
/// No description provided for @importPdf.
///
/// In en, this message translates to:
/// **'Import PDF'**
String get importPdf;
/// No description provided for @importPpt.
///
/// In en, this message translates to:
/// **'Import PPT'**
String get importPpt;
/// No description provided for @penCanvasBeta.
///
/// In en, this message translates to:
/// **'Pen Canvas (beta)'**
String get penCanvasBeta;
/// No description provided for @newNote.
///
/// In en, this message translates to:
/// **'New Note'**
String get newNote;
/// No description provided for @open.
///
/// In en, this message translates to:
/// **'Open'**
String get open;
/// No description provided for @cancel.
///
/// In en, this message translates to:
/// **'Cancel'**
String get cancel;
/// No description provided for @delete.
///
/// In en, this message translates to:
/// **'Delete'**
String get delete;
/// No description provided for @deleteNoteTitle.
///
/// In en, this message translates to:
/// **'Delete note?'**
String get deleteNoteTitle;
/// No description provided for @deleteNote.
///
/// In en, this message translates to:
/// **'Delete note'**
String get deleteNote;
/// No description provided for @openInSplitView.
///
/// In en, this message translates to:
/// **'Open in Split View'**
String get openInSplitView;
/// No description provided for @splitViewSubtitle.
///
/// In en, this message translates to:
/// **'PDF reference + scratchpad'**
String get splitViewSubtitle;
/// No description provided for @removeDocument.
///
/// In en, this message translates to:
/// **'Remove document'**
String get removeDocument;
/// No description provided for @ok.
///
/// In en, this message translates to:
/// **'OK'**
String get ok;
/// No description provided for @pickColor.
///
/// In en, this message translates to:
/// **'Pick a color'**
String get pickColor;
/// No description provided for @clearSettingsTitle.
///
/// In en, this message translates to:
/// **'Clear all local settings?'**
String get clearSettingsTitle;
/// No description provided for @clear.
///
/// In en, this message translates to:
/// **'Clear'**
String get clear;
/// No description provided for @settingsReset.
///
/// In en, this message translates to:
/// **'Settings reset to defaults'**
String get settingsReset;
/// No description provided for @themeSystem.
///
/// In en, this message translates to:
/// **'System'**
String get themeSystem;
/// No description provided for @themeLight.
///
/// In en, this message translates to:
/// **'Light'**
String get themeLight;
/// No description provided for @themeDark.
///
/// In en, this message translates to:
/// **'Dark'**
String get themeDark;
/// No description provided for @seedColorDesc.
///
/// In en, this message translates to:
/// **'Seed color for Material 3 theme'**
String get seedColorDesc;
/// No description provided for @searchHint.
///
/// In en, this message translates to:
/// **'Search notes and documents...'**
String get searchHint;
/// No description provided for @searchError.
///
/// In en, this message translates to:
/// **'Search error: {error}'**
String searchError(String error);
/// No description provided for @noResultsFor.
///
/// In en, this message translates to:
/// **'No results for \"{query}\"'**
String noResultsFor(String query);
/// No description provided for @typeToSearch.
///
/// In en, this message translates to:
/// **'Type to search your notes and documents'**
String get typeToSearch;
/// No description provided for @sectionNotes.
///
/// In en, this message translates to:
/// **'Notes'**
String get sectionNotes;
/// No description provided for @sectionDocuments.
///
/// In en, this message translates to:
/// **'Documents'**
String get sectionDocuments;
/// No description provided for @pageLabel.
///
/// In en, this message translates to:
/// **'Page {page}'**
String pageLabel(int page);
/// No description provided for @processingPptx.
///
/// In en, this message translates to:
/// **'Processing PPTX...'**
String get processingPptx;
/// No description provided for @processingPresentation.
///
/// In en, this message translates to:
/// **'Processing presentation...'**
String get processingPresentation;
/// No description provided for @couldNotOpenPresentation.
///
/// In en, this message translates to:
/// **'Could not open presentation.'**
String get couldNotOpenPresentation;
/// No description provided for @toolPen.
///
/// In en, this message translates to:
/// **'Pen'**
String get toolPen;
/// No description provided for @toolHighlighter.
///
/// In en, this message translates to:
/// **'Highlighter'**
String get toolHighlighter;
/// No description provided for @toolEraser.
///
/// In en, this message translates to:
/// **'Eraser'**
String get toolEraser;
/// No description provided for @brushPicker.
///
/// In en, this message translates to:
/// **'Brush'**
String get brushPicker;
/// No description provided for @brushFountainPen.
///
/// In en, this message translates to:
/// **'Fountain pen'**
String get brushFountainPen;
/// No description provided for @brushBallpoint.
///
/// In en, this message translates to:
/// **'Ballpoint'**
String get brushBallpoint;
/// No description provided for @brushPencil.
///
/// In en, this message translates to:
/// **'Pencil'**
String get brushPencil;
/// No description provided for @brushHighlighter.
///
/// In en, this message translates to:
/// **'Highlighter'**
String get brushHighlighter;
/// No description provided for @actionUndo.
///
/// In en, this message translates to:
/// **'Undo'**
String get actionUndo;
/// No description provided for @actionRedo.
///
/// In en, this message translates to:
/// **'Redo'**
String get actionRedo;
/// No description provided for @fingerDrawingOn.
///
/// In en, this message translates to:
/// **'Finger drawing ON'**
String get fingerDrawingOn;
/// No description provided for @fingerDrawingOff.
///
/// In en, this message translates to:
/// **'Finger drawing OFF (pen only)'**
String get fingerDrawingOff;
/// No description provided for @pages.
///
/// In en, this message translates to:
/// **'Pages'**
String get pages;
/// No description provided for @penSettings.
///
/// In en, this message translates to:
/// **'Pen settings'**
String get penSettings;
/// No description provided for @inputDiagnostic.
///
/// In en, this message translates to:
/// **'Input diagnostic (writes a log file)'**
String get inputDiagnostic;
/// No description provided for @back.
///
/// In en, this message translates to:
/// **'Back'**
String get back;
/// No description provided for @previousPage.
///
/// In en, this message translates to:
/// **'Previous page'**
String get previousPage;
/// No description provided for @nextPage.
///
/// In en, this message translates to:
/// **'Next page'**
String get nextPage;
/// No description provided for @toolSelectText.
///
/// In en, this message translates to:
/// **'Select text'**
String get toolSelectText;
/// No description provided for @actionHighlightSelection.
///
/// In en, this message translates to:
/// **'Highlight selection'**
String get actionHighlightSelection;
/// No description provided for @failedToOpenPdf.
///
/// In en, this message translates to:
/// **'Failed to open PDF:\n{error}'**
String failedToOpenPdf(String error);
/// No description provided for @pdfNoPages.
///
/// In en, this message translates to:
/// **'PDF has no pages.'**
String get pdfNoPages;
/// No description provided for @pageOfPages.
///
/// In en, this message translates to:
/// **'{current} / {total}'**
String pageOfPages(int current, int total);
/// No description provided for @board.
///
/// In en, this message translates to:
/// **'Board'**
String get board;
/// No description provided for @boardTitle.
///
/// In en, this message translates to:
/// **'Sticky Board'**
String get boardTitle;
/// No description provided for @boardOpen.
///
/// In en, this message translates to:
/// **'Sticky note board'**
String get boardOpen;
/// No description provided for @boardAddCard.
///
/// In en, this message translates to:
/// **'Add card'**
String get boardAddCard;
/// No description provided for @boardNewCardText.
///
/// In en, this message translates to:
/// **'New note'**
String get boardNewCardText;
/// No description provided for @boardDeleteCard.
///
/// In en, this message translates to:
/// **'Delete card'**
String get boardDeleteCard;
/// No description provided for @boardDeleteCardTitle.
///
/// In en, this message translates to:
/// **'Delete this card?'**
String get boardDeleteCardTitle;
/// No description provided for @boardBacklinks.
///
/// In en, this message translates to:
/// **'Linked from'**
String get boardBacklinks;
/// No description provided for @boardNoBacklinks.
///
/// In en, this message translates to:
/// **'Nothing links here yet'**
String get boardNoBacklinks;
/// No description provided for @boardDanglingLink.
///
/// In en, this message translates to:
/// **'No card named \"{target}\"'**
String boardDanglingLink(String target);
/// No description provided for @close.
///
/// In en, this message translates to:
/// **'Close'**
String get close;
}
class _AppLocalizationsDelegate
extends LocalizationsDelegate<AppLocalizations> {
const _AppLocalizationsDelegate();
@override
Future<AppLocalizations> load(Locale locale) {
return SynchronousFuture<AppLocalizations>(lookupAppLocalizations(locale));
}
@override
bool isSupported(Locale locale) =>
<String>['en', 'zh'].contains(locale.languageCode);
@override
bool shouldReload(_AppLocalizationsDelegate old) => false;
}
AppLocalizations lookupAppLocalizations(Locale locale) {
// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'en':
return AppLocalizationsEn();
case 'zh':
return AppLocalizationsZh();
}
throw FlutterError(
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.',
);
}