Halkyon's shared packages
A pub workspace of the Dart packages Halkyon's apps share: halkyon_ui, Halkyon's look (the theme, fonts, layout and shared widgets, with texts in English and German), halkyon_core's low-level primitives and halkyon_interop's cross-app contracts. Dart 3.13 with LeanCode's lints, configured once at the root; apps take a package by git, pinned to a signed commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
commit
80fa7b9628
7 changed files with 6762 additions and 0 deletions
21
packages/halkyon_ui/lib/l10n/halkyon_ui_de.arb
Normal file
21
packages/halkyon_ui/lib/l10n/halkyon_ui_de.arb
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"@@locale": "de",
|
||||
|
||||
"brand": "Halkyon",
|
||||
"close": "Schließen",
|
||||
"cancel": "Abbrechen",
|
||||
"undo": "Rückgängig",
|
||||
"dragToReorder": "Zum Umsortieren ziehen",
|
||||
"reorder": "Umsortieren",
|
||||
"reorderDone": "Fertig",
|
||||
"requiredField": "Pflichtfeld",
|
||||
"decrease": "Verringern",
|
||||
"increase": "Erhöhen",
|
||||
"typeANumber": "Zahl eingeben",
|
||||
"gone": "Das gibt es nicht mehr. Vielleicht wurde es auf einem anderen Gerät gelöscht.",
|
||||
"moreInfo": "Weitere Informationen",
|
||||
"copiedToClipboard": "In die Zwischenablage kopiert",
|
||||
"copy": "Kopieren",
|
||||
"paletteColorName": "{name, select, carrot{Karotte} cerise{Kirschrot} cobalt{Kobalt} copper{Kupfer} enzian{Enzian} fern{Farn} forest{Wald} ocean{Ozean} olive{Olive} pacific{Pazifik} pickle{Essiggurke} pine{Kiefer} pink{Rosa} plum{Pflaume} purple{Lila} reef{Riff} sahara{Sahara} slateblue{Schieferblau} soil{Erde} strawberry{Erdbeere} other{{name}}}",
|
||||
"colorPickerLabel": "Farbe: {color}"
|
||||
}
|
||||
42
packages/halkyon_ui/lib/l10n/halkyon_ui_en.arb
Normal file
42
packages/halkyon_ui/lib/l10n/halkyon_ui_en.arb
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"@@locale": "en",
|
||||
|
||||
"brand": "Halkyon",
|
||||
"@brand": {
|
||||
"description": "The brand's word, above an app's own in its wordmark (\"Halkyon\" over \"Learn\")."
|
||||
},
|
||||
"close": "Close",
|
||||
"cancel": "Cancel",
|
||||
"undo": "Undo",
|
||||
"dragToReorder": "Drag to reorder",
|
||||
"reorder": "Reorder",
|
||||
"reorderDone": "Done",
|
||||
"requiredField": "Required",
|
||||
"@requiredField": {
|
||||
"description": "Below a required field while it is empty."
|
||||
},
|
||||
"decrease": "Decrease",
|
||||
"increase": "Increase",
|
||||
"typeANumber": "Type a number",
|
||||
"gone": "This no longer exists. It may have been deleted on another device.",
|
||||
"moreInfo": "More info",
|
||||
"copiedToClipboard": "Copied to clipboard",
|
||||
"copy": "Copy",
|
||||
"paletteColorName": "{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}}}",
|
||||
"@paletteColorName": {
|
||||
"description": "A colour of the palette content can take, by its stored name.",
|
||||
"placeholders": {
|
||||
"name": {
|
||||
"type": "String"
|
||||
}
|
||||
}
|
||||
},
|
||||
"colorPickerLabel": "Colour: {color}",
|
||||
"@colorPickerLabel": {
|
||||
"placeholders": {
|
||||
"color": {
|
||||
"type": "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
packages/halkyon_ui/lib/l10n/halkyon_ui_en_GB.arb
Normal file
3
packages/halkyon_ui/lib/l10n/halkyon_ui_en_GB.arb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"@@locale": "en_GB"
|
||||
}
|
||||
5
packages/halkyon_ui/lib/l10n/halkyon_ui_en_US.arb
Normal file
5
packages/halkyon_ui/lib/l10n/halkyon_ui_en_US.arb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"@@locale": "en_US",
|
||||
|
||||
"colorPickerLabel": "Color: {color}"
|
||||
}
|
||||
257
packages/halkyon_ui/lib/l10n/halkyon_ui_localizations.dart
Normal file
257
packages/halkyon_ui/lib/l10n/halkyon_ui_localizations.dart
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
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);
|
||||
}
|
||||
|
||||
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.',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
// ignore: unused_import
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
|
||||
import 'halkyon_ui_localizations.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
/// The translations for German (`de`).
|
||||
class HalkyonUiLocalizationsDe extends HalkyonUiLocalizations {
|
||||
HalkyonUiLocalizationsDe([String locale = 'de']) : super(locale);
|
||||
|
||||
@override
|
||||
String get brand => 'Halkyon';
|
||||
|
||||
@override
|
||||
String get close => 'Schließen';
|
||||
|
||||
@override
|
||||
String get cancel => 'Abbrechen';
|
||||
|
||||
@override
|
||||
String get undo => 'Rückgängig';
|
||||
|
||||
@override
|
||||
String get dragToReorder => 'Zum Umsortieren ziehen';
|
||||
|
||||
@override
|
||||
String get reorder => 'Umsortieren';
|
||||
|
||||
@override
|
||||
String get reorderDone => 'Fertig';
|
||||
|
||||
@override
|
||||
String get requiredField => 'Pflichtfeld';
|
||||
|
||||
@override
|
||||
String get decrease => 'Verringern';
|
||||
|
||||
@override
|
||||
String get increase => 'Erhöhen';
|
||||
|
||||
@override
|
||||
String get typeANumber => 'Zahl eingeben';
|
||||
|
||||
@override
|
||||
String get gone =>
|
||||
'Das gibt es nicht mehr. Vielleicht wurde es auf einem anderen Gerät gelöscht.';
|
||||
|
||||
@override
|
||||
String get moreInfo => 'Weitere Informationen';
|
||||
|
||||
@override
|
||||
String get copiedToClipboard => 'In die Zwischenablage kopiert';
|
||||
|
||||
@override
|
||||
String get copy => 'Kopieren';
|
||||
|
||||
@override
|
||||
String paletteColorName(String name) {
|
||||
String _temp0 = intl.Intl.selectLogic(
|
||||
name,
|
||||
{
|
||||
'carrot': 'Karotte',
|
||||
'cerise': 'Kirschrot',
|
||||
'cobalt': 'Kobalt',
|
||||
'copper': 'Kupfer',
|
||||
'enzian': 'Enzian',
|
||||
'fern': 'Farn',
|
||||
'forest': 'Wald',
|
||||
'ocean': 'Ozean',
|
||||
'olive': 'Olive',
|
||||
'pacific': 'Pazifik',
|
||||
'pickle': 'Essiggurke',
|
||||
'pine': 'Kiefer',
|
||||
'pink': 'Rosa',
|
||||
'plum': 'Pflaume',
|
||||
'purple': 'Lila',
|
||||
'reef': 'Riff',
|
||||
'sahara': 'Sahara',
|
||||
'slateblue': 'Schieferblau',
|
||||
'soil': 'Erde',
|
||||
'strawberry': 'Erdbeere',
|
||||
'other': '$name',
|
||||
},
|
||||
);
|
||||
return '$_temp0';
|
||||
}
|
||||
|
||||
@override
|
||||
String colorPickerLabel(String color) {
|
||||
return 'Farbe: $color';
|
||||
}
|
||||
}
|
||||
108
packages/halkyon_ui/lib/l10n/halkyon_ui_localizations_en.dart
Normal file
108
packages/halkyon_ui/lib/l10n/halkyon_ui_localizations_en.dart
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
// ignore: unused_import
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
|
||||
import 'halkyon_ui_localizations.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
/// The translations for English (`en`).
|
||||
class HalkyonUiLocalizationsEn extends HalkyonUiLocalizations {
|
||||
HalkyonUiLocalizationsEn([String locale = 'en']) : super(locale);
|
||||
|
||||
@override
|
||||
String get brand => 'Halkyon';
|
||||
|
||||
@override
|
||||
String get close => 'Close';
|
||||
|
||||
@override
|
||||
String get cancel => 'Cancel';
|
||||
|
||||
@override
|
||||
String get undo => 'Undo';
|
||||
|
||||
@override
|
||||
String get dragToReorder => 'Drag to reorder';
|
||||
|
||||
@override
|
||||
String get reorder => 'Reorder';
|
||||
|
||||
@override
|
||||
String get reorderDone => 'Done';
|
||||
|
||||
@override
|
||||
String get requiredField => 'Required';
|
||||
|
||||
@override
|
||||
String get decrease => 'Decrease';
|
||||
|
||||
@override
|
||||
String get increase => 'Increase';
|
||||
|
||||
@override
|
||||
String get typeANumber => 'Type a number';
|
||||
|
||||
@override
|
||||
String get gone =>
|
||||
'This no longer exists. It may have been deleted on another device.';
|
||||
|
||||
@override
|
||||
String get moreInfo => 'More info';
|
||||
|
||||
@override
|
||||
String get copiedToClipboard => 'Copied to clipboard';
|
||||
|
||||
@override
|
||||
String get copy => 'Copy';
|
||||
|
||||
@override
|
||||
String paletteColorName(String name) {
|
||||
String _temp0 = intl.Intl.selectLogic(
|
||||
name,
|
||||
{
|
||||
'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',
|
||||
},
|
||||
);
|
||||
return '$_temp0';
|
||||
}
|
||||
|
||||
@override
|
||||
String colorPickerLabel(String color) {
|
||||
return 'Colour: $color';
|
||||
}
|
||||
}
|
||||
|
||||
/// The translations for English, as used in the United Kingdom (`en_GB`).
|
||||
class HalkyonUiLocalizationsEnGb extends HalkyonUiLocalizationsEn {
|
||||
HalkyonUiLocalizationsEnGb() : super('en_GB');
|
||||
}
|
||||
|
||||
/// The translations for English, as used in the United States (`en_US`).
|
||||
class HalkyonUiLocalizationsEnUs extends HalkyonUiLocalizationsEn {
|
||||
HalkyonUiLocalizationsEnUs() : super('en_US');
|
||||
|
||||
@override
|
||||
String colorPickerLabel(String color) {
|
||||
return 'Color: $color';
|
||||
}
|
||||
}
|
||||
Reference in a new issue