angular-material-extensions / select-country

Angular Material component that allow users to select a country or nationality with an autocomplete feature
https://angular-material-extensions.github.io/select-country/
MIT License
126 stars 40 forks source link

translation not working with predefined [countries] input #124

Closed bable3 closed 1 year ago

bable3 commented 1 year ago

Describe the bug

Predefined countries array in input with a language bugs. The input takes the name from the predefined countries list. If I write it in English, it will be displayed in English even if it's supposed to be in french...

To Reproduce create a predefined countries array and put in countries array set default language in French MatSelectCountryModule.forRoot('fr'),

Expected behavior It's supposed to use the language provided in root

Rogermax commented 1 year ago

Hi,

Not sure if that's the expected behavior. If predefinedCountries is supplied, you're supplying also the country names, maybe some people want that names to be different than the originals.

I think you can't accomplish that, unless you translate manually the names. Using [language] property would not work either, because when language is changed all countries are loaded in that new language and predefinedCountries are lost.

Next package version will come with the PR #120 that has internal improvements and is much more tested, in that version property [language] respect predefinedCountries list as a filter of all countries.