Merge branch 'main' into spike/block2-derisking
# Conflicts: # apps/app_seeds/lib/i18n/strings.g.dart
This commit is contained in:
commit
1fb8e37536
25 changed files with 2396 additions and 36 deletions
|
|
@ -206,7 +206,11 @@ class TaneApp extends StatelessWidget {
|
|||
// desktop (Flutter disables that by default), so the photo carousel and
|
||||
// lists swipe there too.
|
||||
scrollBehavior: const _DragScrollBehavior(),
|
||||
locale: TranslationProvider.of(context).flutterLocale,
|
||||
// Flutter ships no Material/Cupertino localizations for Asturian
|
||||
// (`ast`), so render the framework chrome (date pickers, native dialog
|
||||
// buttons) in Spanish — the closest shipped language — while the app's
|
||||
// own text stays Asturian via slang. Every other locale maps 1:1.
|
||||
locale: materialLocaleFor(TranslationProvider.of(context).flutterLocale),
|
||||
supportedLocales: AppLocaleUtils.supportedLocales,
|
||||
localizationsDelegates: const [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
|
|
@ -224,6 +228,14 @@ class TaneApp extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
/// Maps the app's active locale to one Flutter's bundled Material/Cupertino
|
||||
/// localizations can serve. Asturian (`ast`) has none, so it borrows Spanish
|
||||
/// (`es`) for the framework chrome; the app's own strings stay Asturian (they
|
||||
/// come from slang, not from `Localizations`). All other locales pass through.
|
||||
@visibleForTesting
|
||||
Locale materialLocaleFor(Locale locale) =>
|
||||
locale.languageCode == 'ast' ? const Locale('es') : locale;
|
||||
|
||||
/// Enables mouse/trackpad drag scrolling (off by default on desktop) so the
|
||||
/// photo carousel and lists can be swiped with a pointer.
|
||||
class _DragScrollBehavior extends MaterialScrollBehavior {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue