This repository has been archived on 2026-10-23. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
halkyon_shared/packages/halkyon_app/lib/src/instance/cldr_license.dart
Tizian 「ティツィアーン」 96f2d14618
halkyon_app: data locations as precise as a country or a state
An operator's DATA_LOCATION and BACKUP_LOCATION may name a subdivision
(ISO 3166-2, US-CA, DE-BY) besides the EU or a country. The app adds
"(EU)" to a member country and the country to a subdivision ("Germany
(EU)", "California, United States", "Bavaria, Germany (EU)"), in
English and German, and shows the most specific flag there is: a
subdivision's own where the flag package has one, else its country's.
Subdivision names come from Unicode CLDR 48.2 (tool/subdivision_names.py),
bundled with their licence, which the app registers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-19 18:50:26 +02:00

27 lines
1 KiB
Dart

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:halkyon_app/src/instance/flag_icons_license.dart';
/// Adds Unicode CLDR's notice to the app's licence list, beside the
/// packages' own: the subdivisions' names come from it
/// (`AssetSubdivisionNames`), and its licence asks that its notice go with
/// them.
void registerCldrLicense() => LicenseRegistry.addLicense(() async* {
yield LicenseEntryWithLineBreaks(
const ['Unicode CLDR'],
await rootBundle.loadString(cldrLicenseAsset),
);
});
/// Where the notice is, among this package's assets: verbatim from the
/// release the names come from.
const cldrLicenseAsset =
'packages/halkyon_app/assets/subdivisions/LICENSE-CLDR.txt';
/// Adds every notice the package's own assets ask for to the app's licence
/// list: the flags' ([registerFlagIconsLicense]) and Unicode CLDR's
/// ([registerCldrLicense]). An app calls it once at startup.
void registerHalkyonAppLicenses() {
registerFlagIconsLicense();
registerCldrLicense();
}