2026-10-18 21:46:55 +02:00
|
|
|
|
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 'halkyon_ui_localizations_de.dart';
|
|
|
|
|
|
import 'halkyon_ui_localizations_en.dart';
|
|
|
|
|
|
|
|
|
|
|
|
// ignore_for_file: type=lint
|
|
|
|
|
|
|
|
|
|
|
|
/// Callers can lookup localized strings with an instance of HalkyonUiLocalizations
|
|
|
|
|
|
/// returned by `HalkyonUiLocalizations.of(context)`.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// Applications need to include `HalkyonUiLocalizations.delegate()` in their app's
|
|
|
|
|
|
/// `localizationDelegates` list, and the locales they support in the app's
|
|
|
|
|
|
/// `supportedLocales` list. For example:
|
|
|
|
|
|
///
|
|
|
|
|
|
/// ```dart
|
|
|
|
|
|
/// import 'l10n/halkyon_ui_localizations.dart';
|
|
|
|
|
|
///
|
|
|
|
|
|
/// return MaterialApp(
|
|
|
|
|
|
/// localizationsDelegates: HalkyonUiLocalizations.localizationsDelegates,
|
|
|
|
|
|
/// supportedLocales: HalkyonUiLocalizations.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, you’ll need to edit this
|
|
|
|
|
|
/// file.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// First, open your project’s ios/Runner.xcworkspace Xcode workspace file.
|
|
|
|
|
|
/// Then, in the Project Navigator, open the Info.plist file under the Runner
|
|
|
|
|
|
/// project’s 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 HalkyonUiLocalizations.supportedLocales
|
|
|
|
|
|
/// property.
|
|
|
|
|
|
abstract class HalkyonUiLocalizations {
|
|
|
|
|
|
HalkyonUiLocalizations(String locale)
|
|
|
|
|
|
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
|
|
|
|
|
|
|
|
|
|
|
|
final String localeName;
|
|
|
|
|
|
|
|
|
|
|
|
static HalkyonUiLocalizations of(BuildContext context) {
|
|
|
|
|
|
return Localizations.of<HalkyonUiLocalizations>(
|
|
|
|
|
|
context,
|
|
|
|
|
|
HalkyonUiLocalizations,
|
|
|
|
|
|
)!;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const LocalizationsDelegate<HalkyonUiLocalizations> delegate =
|
|
|
|
|
|
_HalkyonUiLocalizationsDelegate();
|
|
|
|
|
|
|
|
|
|
|
|
/// 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('de'),
|
|
|
|
|
|
Locale('en'),
|
|
|
|
|
|
Locale('en', 'GB'),
|
|
|
|
|
|
Locale('en', 'US'),
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
/// The brand's word, above an app's own in its wordmark ("Halkyon" over "Learn").
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Halkyon'**
|
|
|
|
|
|
String get brand;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @close.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Close'**
|
|
|
|
|
|
String get close;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @cancel.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Cancel'**
|
|
|
|
|
|
String get cancel;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @undo.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Undo'**
|
|
|
|
|
|
String get undo;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @dragToReorder.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Drag to reorder'**
|
|
|
|
|
|
String get dragToReorder;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @reorder.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Reorder'**
|
|
|
|
|
|
String get reorder;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @reorderDone.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Done'**
|
|
|
|
|
|
String get reorderDone;
|
|
|
|
|
|
|
|
|
|
|
|
/// Below a required field while it is empty.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Required'**
|
|
|
|
|
|
String get requiredField;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @decrease.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Decrease'**
|
|
|
|
|
|
String get decrease;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @increase.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Increase'**
|
|
|
|
|
|
String get increase;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @typeANumber.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Type a number'**
|
|
|
|
|
|
String get typeANumber;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @gone.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'This no longer exists. It may have been deleted on another device.'**
|
|
|
|
|
|
String get gone;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @moreInfo.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'More info'**
|
|
|
|
|
|
String get moreInfo;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @copiedToClipboard.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Copied to clipboard'**
|
|
|
|
|
|
String get copiedToClipboard;
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @copy.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Copy'**
|
|
|
|
|
|
String get copy;
|
|
|
|
|
|
|
|
|
|
|
|
/// A colour of the palette content can take, by its stored name.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'{name, select, carrot{Carrot} cerise{Cerise} cobalt{Cobalt} copper{Copper} enzian{Enzian} fern{Fern} forest{Forest} ocean{Ocean} olive{Olive} pacific{Pacific} pickle{Pickle} pine{Pine} pink{Pink} plum{Plum} purple{Purple} reef{Reef} sahara{Sahara} slateblue{Slate blue} soil{Soil} strawberry{Strawberry} other{{name}}}'**
|
|
|
|
|
|
String paletteColorName(String name);
|
|
|
|
|
|
|
|
|
|
|
|
/// No description provided for @colorPickerLabel.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Colour: {color}'**
|
|
|
|
|
|
String colorPickerLabel(String color);
|
2026-11-03 21:27:16 +01:00
|
|
|
|
|
|
|
|
|
|
/// Tooltip of the question mark that opens a text explaining a section or setting (HelpButton).
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'What\'s this?'**
|
|
|
|
|
|
String get explain;
|
feat: the rail opens into a sidebar with labels from expanded windows on
Decided by the developer on 9 and 10 Nov 2026: phones keep the bar,
medium windows (600 to 840 dp) the rail alone, and from 840 dp a toggle
at the rail's foot opens it into a sidebar 256 dp wide, as Proton
Drive's: the app named beside its icon, each tab its label beside its
icon, the icons where the rail had them, so nothing moves under the
pointer. Its labels come in one after another, top to bottom, all at once
where animations are off. Open or closed is kept per device, in
halkyon_app's Look (look.json, `sidebar`), which Learn keeps in its
DeviceSettings (`sidebarOpen`), as it does the appearance and language.
NavigationFrame takes sidebarOpen and onSidebarChanged (no toggle without
it), and sidebarSections, what the app lists below the tabs, which Todo's
favourites and projects will be. The closed rail keeps Flutter's widget,
its toggle pinned at the foot (trailingAtBottom); the open one is the
frame's own, as the staggered labels need. Learn, Todo, Train and
Meditate keep the choice.
Whats-New: In wide windows, the button at the foot of the side rail opens it into a sidebar with names, and it stays open.
Whats-New-De: In breiten Fenstern öffnet der Knopf unten an der Seitenleiste sie mit Namen, und sie bleibt offen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-11-10 16:44:08 +01:00
|
|
|
|
|
|
|
|
|
|
/// Tooltip of the toggle at the foot of the rail opening it into a sidebar with labels.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Open sidebar'**
|
|
|
|
|
|
String get openSidebar;
|
|
|
|
|
|
|
|
|
|
|
|
/// Tooltip of the toggle at the foot of the sidebar closing it into the rail.
|
|
|
|
|
|
///
|
|
|
|
|
|
/// In en, this message translates to:
|
|
|
|
|
|
/// **'Close sidebar'**
|
|
|
|
|
|
String get closeSidebar;
|
2026-10-18 21:46:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _HalkyonUiLocalizationsDelegate
|
|
|
|
|
|
extends LocalizationsDelegate<HalkyonUiLocalizations> {
|
|
|
|
|
|
const _HalkyonUiLocalizationsDelegate();
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
Future<HalkyonUiLocalizations> load(Locale locale) {
|
|
|
|
|
|
return SynchronousFuture<HalkyonUiLocalizations>(
|
|
|
|
|
|
lookupHalkyonUiLocalizations(locale),
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
bool isSupported(Locale locale) =>
|
|
|
|
|
|
<String>['de', 'en'].contains(locale.languageCode);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
bool shouldReload(_HalkyonUiLocalizationsDelegate old) => false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
HalkyonUiLocalizations lookupHalkyonUiLocalizations(Locale locale) {
|
|
|
|
|
|
// Lookup logic when language+country codes are specified.
|
|
|
|
|
|
switch (locale.languageCode) {
|
|
|
|
|
|
case 'en':
|
|
|
|
|
|
{
|
|
|
|
|
|
switch (locale.countryCode) {
|
|
|
|
|
|
case 'GB':
|
|
|
|
|
|
return HalkyonUiLocalizationsEnGb();
|
|
|
|
|
|
case 'US':
|
|
|
|
|
|
return HalkyonUiLocalizationsEnUs();
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Lookup logic when only language code is specified.
|
|
|
|
|
|
switch (locale.languageCode) {
|
|
|
|
|
|
case 'de':
|
|
|
|
|
|
return HalkyonUiLocalizationsDe();
|
|
|
|
|
|
case 'en':
|
|
|
|
|
|
return HalkyonUiLocalizationsEn();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
throw FlutterError(
|
|
|
|
|
|
'HalkyonUiLocalizations.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.',
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|