-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Change supported locales #359
Comments
The |
@rami-a The file |
I have studied this: https://github.com/flutter/gallery/blob/master/lib/l10n/README.md ... and I'm still wondering how I can change supported locales permanently ... 😦 |
Interesting, @shihaohong could you take a look? |
@Megidd Could you further describe your use case? Do you only want a subset of return MaterialApp(
// ...
initialRoute: initialRoute,
- supportedLocales: GalleryLocalizations.supportedLocales,
+ supportedLocales: [
+ const Locale('en'),
+ const Locale('he'),
+ ],
locale: GalleryOptions.of(context).locale,
localeResolutionCallback: (locale, supportedLocales) {
deviceLocale = locale;
return locale;
},
// ... |
Actually, I took a look at var supportedLocales =
List<Locale>.from(GalleryLocalizations.supportedLocales); to the custom list you want to use.
|
I'll close the issue for now, but feel free to reopen it if I misunderstood something! |
@shihaohong Thanks! 😃 I can confirm that supported locales of settings page are on file - var supportedLocales =
- List<Locale>.from(GalleryLocalizations.supportedLocales);
+ var supportedLocales = [
+ const Locale('en'),
+ const Locale('he'),
+ ];
supportedLocales.removeWhere((locale) => locale == deviceLocale); |
I'm changing this line according to the relevant documentation by this patch:
But the locales options on settings page are not modified. Any idea why?
I have a feeling like to change supported locales, I need to change
l10n.yaml
file. But I don't know what options are available. Can anybody help? Thanks!The text was updated successfully, but these errors were encountered: