Daniel-Ioannou / flutter_country_picker

A flutter package to select a country from a list of countries.
https://pub.dev/packages/country_picker
MIT License
126 stars 174 forks source link

Warning: This application's locale, ht, is not supported by all of its localization delegates. #141

Closed Miguel-A-Jara closed 8 months ago

Miguel-A-Jara commented 9 months ago

First of all, thanks for this package, you're a lifesaver and thank you for the time you put on maintaining this package alive.

I'm having this problem when using a custom locale Haitian Creole ('ht'). I have followed the instructions from the Flutter Documentation on how to add a custom locale, and everything works well within my app, but after adding this package, if the initialization occurs in the HT locale, an exception is throw with the following message:

════════ Exception caught by widgets ═══════════════════════════════════════════
The following message was thrown:
Warning: This application's locale, ht, is not supported by all of its localization delegates.

• A CountryLocalizations delegate that supports the ht locale was not found.

The declared supported locales for this app are: en, ar, bg, es, ht, pt_BR, pt_PT, ro, sk

See https://flutter.dev/tutorials/internationalization/ for more information about configuring an app's locale, supportedLocales, and localizationsDelegates parameters.
════════════════════════════════════════════════════════════════════════════════

This only occurs when the CountryLocalizations.delegate is set on the MaterialApp.localizationsDelegates property.

I wonder if this issue can be solved by just adding the support for this new language? Or is this a different issue?