-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Feature proposal
Based on @mlopezFC 's comment on #3 "It would be great to be able to only allow the selection for certain locales / countries".
What ideas come to your minds about it?
Currently, the addon is limited by the flag-icons package (which provides the flag icons). It renders the flags based on ISO 3166-1-alpha-2 (a 2 letter country code). Because of this, all the supported locales by the addons are:
public static List<Locale> getAvailableSupportedLocales() {
return Arrays.stream(Locale.getAvailableLocales()).filter(loc -> loc.getCountry().length() == 2)
.toList();
}Maybe it would be a good option to have a helper class or static methods to build only supported locales. Or, we could simply allow the developer to set the locales that they want like:
List<Locale> myDesiredLocales; // list with some locales
LocaleComboBox myCombo = new LocaleComboBox(myDesiredLocales);
// or
myCombo.setItems(myDesiredLocales);The issue with this approach is that it would be possible to add unsupported locales (for which the flags won't show)
So, i'm pretty unsure about it 🤔. Let me know what you think.
Describe solution expectations
No response
Additional information
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status