From 491bc918eb50fc5d4c1321b2aa85171e177e55ed Mon Sep 17 00:00:00 2001 From: vjrj Date: Fri, 10 Jul 2026 20:23:03 +0200 Subject: [PATCH] fix(i18n): map Asturian to Spanish chrome in boot splash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pre-init BootstrapSplash passed the raw device locale to its MaterialApp, so booting under an Asturian (ast) device locale threw the 'locale not supported by localization delegates' warning — the Material/Cupertino delegates ship no ast. The main app already routes ast to Spanish framework chrome via materialLocaleFor; apply the same mapping in the splash. Drop @visibleForTesting since it's now shared production code. --- apps/app_seeds/lib/app.dart | 1 - apps/app_seeds/lib/bootstrap.dart | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/app_seeds/lib/app.dart b/apps/app_seeds/lib/app.dart index 8593a74..afe5bc5 100644 --- a/apps/app_seeds/lib/app.dart +++ b/apps/app_seeds/lib/app.dart @@ -256,7 +256,6 @@ class TaneApp extends StatelessWidget { /// 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; diff --git a/apps/app_seeds/lib/bootstrap.dart b/apps/app_seeds/lib/bootstrap.dart index 34b58db..7e1d04a 100644 --- a/apps/app_seeds/lib/bootstrap.dart +++ b/apps/app_seeds/lib/bootstrap.dart @@ -110,7 +110,9 @@ class BootstrapSplash extends StatelessWidget { return MaterialApp( debugShowCheckedModeBanner: false, theme: buildTaneTheme(), - locale: TranslationProvider.of(context).flutterLocale, + // Asturian (`ast`) has no bundled Material/Cupertino localizations, so map + // it to Spanish for the framework chrome — same as the main app (app.dart). + locale: materialLocaleFor(TranslationProvider.of(context).flutterLocale), supportedLocales: AppLocaleUtils.supportedLocales, localizationsDelegates: const [ GlobalMaterialLocalizations.delegate,