Merge branch 'main' into spike/block2-derisking
This commit is contained in:
commit
12f48ea318
24 changed files with 69558 additions and 341 deletions
|
|
@ -86,7 +86,8 @@
|
|||
"licenseValue": "AGPL-3.0",
|
||||
"website": "Website",
|
||||
"openSourceLicenses": "Open-source licenses",
|
||||
"openSourceLicensesSubtitle": "Third-party libraries and their licenses"
|
||||
"openSourceLicensesSubtitle": "Third-party libraries and their licenses",
|
||||
"copyright": "© {years} Comunes Association, under AGPLv3"
|
||||
},
|
||||
"intro": {
|
||||
"skip": "Skip",
|
||||
|
|
@ -190,6 +191,7 @@
|
|||
"notes": "Notes",
|
||||
"species": "Species (from catalog)",
|
||||
"speciesHint": "Search a species…",
|
||||
"speciesSuggested": "Suggested from the name",
|
||||
"organic": "Organic",
|
||||
"organicHint": "Grown organically (eco)"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@
|
|||
"licenseValue": "AGPL-3.0",
|
||||
"website": "Sitio web",
|
||||
"openSourceLicenses": "Licencias de código abierto",
|
||||
"openSourceLicensesSubtitle": "Bibliotecas de terceros y sus licencias"
|
||||
"openSourceLicensesSubtitle": "Bibliotecas de terceros y sus licencias",
|
||||
"copyright": "© {years} Asociación Comunes, bajo AGPLv3"
|
||||
},
|
||||
"intro": {
|
||||
"skip": "Saltar",
|
||||
|
|
@ -190,6 +191,7 @@
|
|||
"notes": "Notas",
|
||||
"species": "Especie (del catálogo)",
|
||||
"speciesHint": "Buscar una especie…",
|
||||
"speciesSuggested": "Sugerida por el nombre",
|
||||
"organic": "Ecológica",
|
||||
"organicHint": "Cultivada de forma ecológica (eco)"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@
|
|||
"licenseValue": "AGPL-3.0",
|
||||
"website": "Sítio web",
|
||||
"openSourceLicenses": "Licenças de código aberto",
|
||||
"openSourceLicensesSubtitle": "Bibliotecas de terceiros e as suas licenças"
|
||||
"openSourceLicensesSubtitle": "Bibliotecas de terceiros e as suas licenças",
|
||||
"copyright": "© {years} Associação Comunes, sob AGPLv3"
|
||||
},
|
||||
"intro": {
|
||||
"skip": "Saltar",
|
||||
|
|
@ -186,6 +187,7 @@
|
|||
"notes": "Notas",
|
||||
"species": "Espécie (do catálogo)",
|
||||
"speciesHint": "Procura uma espécie…",
|
||||
"speciesSuggested": "Sugerida pelo nome",
|
||||
"organic": "Biológica",
|
||||
"organicHint": "Cultivada em modo biológico"
|
||||
},
|
||||
|
|
|
|||
181
apps/app_seeds/lib/i18n/strings.g.dart
Normal file
181
apps/app_seeds/lib/i18n/strings.g.dart
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
/// Generated file. Do not edit.
|
||||
///
|
||||
/// Source: lib/i18n
|
||||
/// To regenerate, run: `dart run slang`
|
||||
///
|
||||
/// Locales: 3
|
||||
/// Strings: 875 (291 per locale)
|
||||
///
|
||||
/// Built on 2026-07-10 at 00:35 UTC
|
||||
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint, unused_import
|
||||
// dart format off
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:slang/generated.dart';
|
||||
import 'package:slang_flutter/slang_flutter.dart';
|
||||
export 'package:slang_flutter/slang_flutter.dart';
|
||||
|
||||
import 'strings_es.g.dart' as l_es;
|
||||
import 'strings_pt.g.dart' as l_pt;
|
||||
part 'strings_en.g.dart';
|
||||
|
||||
/// Supported locales.
|
||||
///
|
||||
/// Usage:
|
||||
/// - LocaleSettings.setLocale(AppLocale.en) // set locale
|
||||
/// - Locale locale = AppLocale.en.flutterLocale // get flutter locale from enum
|
||||
/// - if (LocaleSettings.currentLocale == AppLocale.en) // locale check
|
||||
enum AppLocale with BaseAppLocale<AppLocale, Translations> {
|
||||
en(languageCode: 'en'),
|
||||
es(languageCode: 'es'),
|
||||
pt(languageCode: 'pt');
|
||||
|
||||
const AppLocale({
|
||||
required this.languageCode,
|
||||
this.scriptCode, // ignore: unused_element, unused_element_parameter
|
||||
this.countryCode, // ignore: unused_element, unused_element_parameter
|
||||
});
|
||||
|
||||
@override final String languageCode;
|
||||
@override final String? scriptCode;
|
||||
@override final String? countryCode;
|
||||
|
||||
@override
|
||||
Future<Translations> build({
|
||||
Map<String, Node>? overrides,
|
||||
PluralResolver? cardinalResolver,
|
||||
PluralResolver? ordinalResolver,
|
||||
}) async {
|
||||
return buildSync(
|
||||
overrides: overrides,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Translations buildSync({
|
||||
Map<String, Node>? overrides,
|
||||
PluralResolver? cardinalResolver,
|
||||
PluralResolver? ordinalResolver,
|
||||
}) {
|
||||
switch (this) {
|
||||
case AppLocale.en:
|
||||
return TranslationsEn(
|
||||
overrides: overrides,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
case AppLocale.es:
|
||||
return l_es.TranslationsEs(
|
||||
overrides: overrides,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
case AppLocale.pt:
|
||||
return l_pt.TranslationsPt(
|
||||
overrides: overrides,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Gets current instance managed by [LocaleSettings].
|
||||
Translations get translations => LocaleSettings.instance.getTranslations(this);
|
||||
}
|
||||
|
||||
/// Method A: Simple
|
||||
///
|
||||
/// No rebuild after locale change.
|
||||
/// Translation happens during initialization of the widget (call of t).
|
||||
/// Configurable via 'translate_var'.
|
||||
///
|
||||
/// Usage:
|
||||
/// String a = t.someKey.anotherKey;
|
||||
/// String b = t['someKey.anotherKey']; // Only for edge cases!
|
||||
Translations get t => LocaleSettings.instance.currentTranslations;
|
||||
|
||||
/// Method B: Advanced
|
||||
///
|
||||
/// All widgets using this method will trigger a rebuild when locale changes.
|
||||
/// Use this if you have e.g. a settings page where the user can select the locale during runtime.
|
||||
///
|
||||
/// Step 1:
|
||||
/// wrap your App with
|
||||
/// TranslationProvider(
|
||||
/// child: MyApp()
|
||||
/// );
|
||||
///
|
||||
/// Step 2:
|
||||
/// final t = Translations.of(context); // Get t variable.
|
||||
/// String a = t.someKey.anotherKey; // Use t variable.
|
||||
/// String b = t['someKey.anotherKey']; // Only for edge cases!
|
||||
class TranslationProvider extends BaseTranslationProvider<AppLocale, Translations> {
|
||||
TranslationProvider({required super.child}) : super(settings: LocaleSettings.instance);
|
||||
|
||||
static InheritedLocaleData<AppLocale, Translations> of(BuildContext context) => InheritedLocaleData.of<AppLocale, Translations>(context);
|
||||
}
|
||||
|
||||
/// Method B shorthand via [BuildContext] extension method.
|
||||
/// Configurable via 'translate_var'.
|
||||
///
|
||||
/// Usage (e.g. in a widget's build method):
|
||||
/// context.t.someKey.anotherKey
|
||||
extension BuildContextTranslationsExtension on BuildContext {
|
||||
Translations get t => TranslationProvider.of(this).translations;
|
||||
}
|
||||
|
||||
/// Manages all translation instances and the current locale
|
||||
class LocaleSettings extends BaseFlutterLocaleSettings<AppLocale, Translations> {
|
||||
LocaleSettings._() : super(
|
||||
utils: AppLocaleUtils.instance,
|
||||
lazy: false,
|
||||
);
|
||||
|
||||
static final instance = LocaleSettings._();
|
||||
|
||||
// static aliases (checkout base methods for documentation)
|
||||
static AppLocale get currentLocale => instance.currentLocale;
|
||||
static Stream<AppLocale> getLocaleStream() => instance.getLocaleStream();
|
||||
static Future<AppLocale> setLocale(AppLocale locale, {bool? listenToDeviceLocale = false}) => instance.setLocale(locale, listenToDeviceLocale: listenToDeviceLocale);
|
||||
static Future<AppLocale> setLocaleRaw(String rawLocale, {bool? listenToDeviceLocale = false}) => instance.setLocaleRaw(rawLocale, listenToDeviceLocale: listenToDeviceLocale);
|
||||
static Future<AppLocale> useDeviceLocale() => instance.useDeviceLocale();
|
||||
static Future<void> setPluralResolver({String? language, AppLocale? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) => instance.setPluralResolver(
|
||||
language: language,
|
||||
locale: locale,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
|
||||
// synchronous versions
|
||||
static AppLocale setLocaleSync(AppLocale locale, {bool? listenToDeviceLocale = false}) => instance.setLocaleSync(locale, listenToDeviceLocale: listenToDeviceLocale);
|
||||
static AppLocale setLocaleRawSync(String rawLocale, {bool? listenToDeviceLocale = false}) => instance.setLocaleRawSync(rawLocale, listenToDeviceLocale: listenToDeviceLocale);
|
||||
static AppLocale useDeviceLocaleSync() => instance.useDeviceLocaleSync();
|
||||
static void setPluralResolverSync({String? language, AppLocale? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) => instance.setPluralResolverSync(
|
||||
language: language,
|
||||
locale: locale,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
}
|
||||
|
||||
/// Provides utility functions without any side effects.
|
||||
class AppLocaleUtils extends BaseAppLocaleUtils<AppLocale, Translations> {
|
||||
AppLocaleUtils._() : super(
|
||||
baseLocale: AppLocale.en,
|
||||
locales: AppLocale.values,
|
||||
);
|
||||
|
||||
static final instance = AppLocaleUtils._();
|
||||
|
||||
// static aliases (checkout base methods for documentation)
|
||||
static AppLocale parse(String rawLocale) => instance.parse(rawLocale);
|
||||
static AppLocale parseLocaleParts({required String languageCode, String? scriptCode, String? countryCode}) => instance.parseLocaleParts(languageCode: languageCode, scriptCode: scriptCode, countryCode: countryCode);
|
||||
static AppLocale findDeviceLocale() => instance.findDeviceLocale();
|
||||
static List<Locale> get supportedLocales => instance.supportedLocales;
|
||||
static List<String> get supportedLocalesRaw => instance.supportedLocalesRaw;
|
||||
}
|
||||
|
|
@ -360,6 +360,9 @@ class Translations$about$en {
|
|||
|
||||
/// en: 'Third-party libraries and their licenses'
|
||||
String get openSourceLicensesSubtitle => 'Third-party libraries and their licenses';
|
||||
|
||||
/// en: '© {years} Comunes Association, under AGPLv3'
|
||||
String copyright({required Object years}) => '© ${years} Comunes Association, under AGPLv3';
|
||||
}
|
||||
|
||||
// Path: intro
|
||||
|
|
@ -630,6 +633,9 @@ class Translations$editVariety$en {
|
|||
/// en: 'Search a species…'
|
||||
String get speciesHint => 'Search a species…';
|
||||
|
||||
/// en: 'Suggested from the name'
|
||||
String get speciesSuggested => 'Suggested from the name';
|
||||
|
||||
/// en: 'Organic'
|
||||
String get organic => 'Organic';
|
||||
|
||||
|
|
@ -1567,6 +1573,7 @@ extension on Translations {
|
|||
'about.website' => 'Website',
|
||||
'about.openSourceLicenses' => 'Open-source licenses',
|
||||
'about.openSourceLicensesSubtitle' => 'Third-party libraries and their licenses',
|
||||
'about.copyright' => ({required Object years}) => '© ${years} Comunes Association, under AGPLv3',
|
||||
'intro.skip' => 'Skip',
|
||||
'intro.next' => 'Next',
|
||||
'intro.start' => 'Get started',
|
||||
|
|
@ -1642,6 +1649,7 @@ extension on Translations {
|
|||
'editVariety.notes' => 'Notes',
|
||||
'editVariety.species' => 'Species (from catalog)',
|
||||
'editVariety.speciesHint' => 'Search a species…',
|
||||
'editVariety.speciesSuggested' => 'Suggested from the name',
|
||||
'editVariety.organic' => 'Organic',
|
||||
'editVariety.organicHint' => 'Grown organically (eco)',
|
||||
'addLot.title' => 'Add lot',
|
||||
|
|
|
|||
|
|
@ -213,6 +213,7 @@ class _Translations$about$es extends Translations$about$en {
|
|||
@override String get website => 'Sitio web';
|
||||
@override String get openSourceLicenses => 'Licencias de código abierto';
|
||||
@override String get openSourceLicensesSubtitle => 'Bibliotecas de terceros y sus licencias';
|
||||
@override String copyright({required Object years}) => '© ${years} Asociación Comunes, bajo AGPLv3';
|
||||
}
|
||||
|
||||
// Path: intro
|
||||
|
|
@ -351,6 +352,7 @@ class _Translations$editVariety$es extends Translations$editVariety$en {
|
|||
@override String get notes => 'Notas';
|
||||
@override String get species => 'Especie (del catálogo)';
|
||||
@override String get speciesHint => 'Buscar una especie…';
|
||||
@override String get speciesSuggested => 'Sugerida por el nombre';
|
||||
@override String get organic => 'Ecológica';
|
||||
@override String get organicHint => 'Cultivada de forma ecológica (eco)';
|
||||
}
|
||||
|
|
@ -1005,6 +1007,7 @@ extension on TranslationsEs {
|
|||
'about.website' => 'Sitio web',
|
||||
'about.openSourceLicenses' => 'Licencias de código abierto',
|
||||
'about.openSourceLicensesSubtitle' => 'Bibliotecas de terceros y sus licencias',
|
||||
'about.copyright' => ({required Object years}) => '© ${years} Asociación Comunes, bajo AGPLv3',
|
||||
'intro.skip' => 'Saltar',
|
||||
'intro.next' => 'Siguiente',
|
||||
'intro.start' => 'Empezar',
|
||||
|
|
@ -1080,6 +1083,7 @@ extension on TranslationsEs {
|
|||
'editVariety.notes' => 'Notas',
|
||||
'editVariety.species' => 'Especie (del catálogo)',
|
||||
'editVariety.speciesHint' => 'Buscar una especie…',
|
||||
'editVariety.speciesSuggested' => 'Sugerida por el nombre',
|
||||
'editVariety.organic' => 'Ecológica',
|
||||
'editVariety.organicHint' => 'Cultivada de forma ecológica (eco)',
|
||||
'addLot.title' => 'Añadir lote',
|
||||
|
|
|
|||
|
|
@ -213,6 +213,7 @@ class _Translations$about$pt extends Translations$about$en {
|
|||
@override String get website => 'Sítio web';
|
||||
@override String get openSourceLicenses => 'Licenças de código aberto';
|
||||
@override String get openSourceLicensesSubtitle => 'Bibliotecas de terceiros e as suas licenças';
|
||||
@override String copyright({required Object years}) => '© ${years} Associação Comunes, sob AGPLv3';
|
||||
}
|
||||
|
||||
// Path: intro
|
||||
|
|
@ -347,6 +348,7 @@ class _Translations$editVariety$pt extends Translations$editVariety$en {
|
|||
@override String get notes => 'Notas';
|
||||
@override String get species => 'Espécie (do catálogo)';
|
||||
@override String get speciesHint => 'Procura uma espécie…';
|
||||
@override String get speciesSuggested => 'Sugerida pelo nome';
|
||||
@override String get organic => 'Biológica';
|
||||
@override String get organicHint => 'Cultivada em modo biológico';
|
||||
}
|
||||
|
|
@ -1001,6 +1003,7 @@ extension on TranslationsPt {
|
|||
'about.website' => 'Sítio web',
|
||||
'about.openSourceLicenses' => 'Licenças de código aberto',
|
||||
'about.openSourceLicensesSubtitle' => 'Bibliotecas de terceiros e as suas licenças',
|
||||
'about.copyright' => ({required Object years}) => '© ${years} Associação Comunes, sob AGPLv3',
|
||||
'intro.skip' => 'Saltar',
|
||||
'intro.next' => 'Seguinte',
|
||||
'intro.start' => 'Começar',
|
||||
|
|
@ -1072,6 +1075,7 @@ extension on TranslationsPt {
|
|||
'editVariety.notes' => 'Notas',
|
||||
'editVariety.species' => 'Espécie (do catálogo)',
|
||||
'editVariety.speciesHint' => 'Procura uma espécie…',
|
||||
'editVariety.speciesSuggested' => 'Sugerida pelo nome',
|
||||
'editVariety.organic' => 'Biológica',
|
||||
'editVariety.organicHint' => 'Cultivada em modo biológico',
|
||||
'addLot.title' => 'Adicionar lote',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue