Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Only use supported locales. (#556)
Browse files Browse the repository at this point in the history
The previous implementation would sometimes select locales that were not actually supported. For example, on my desktop machine it selected "C_UTF-8".
  • Loading branch information
Hixie authored Nov 4, 2021
1 parent 40b00d3 commit 4fd7491
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class GalleryApp extends StatelessWidget {
initialRoute: initialRoute,
supportedLocales: GalleryLocalizations.supportedLocales,
locale: GalleryOptions.of(context).locale,
localeResolutionCallback: (locale, supportedLocales) {
deviceLocale = locale;
return locale;
localeListResolutionCallback: (locales, supportedLocales) {
deviceLocale = locales.first;
return basicLocaleListResolution(locales, supportedLocales);
},
onGenerateRoute: RouteConfiguration.onGenerateRoute,
);
Expand Down

0 comments on commit 4fd7491

Please sign in to comment.