vue-tel-input
vue-tel-input copied to clipboard
Get country name from drop down list in given language
Hello, I would like to know if it is possible to configure a language in which the country names will be displayed.
In my use case, I would like all countries to be displayed with their French names, but I can't find the required configuration, is it possible to implement this? Or give a solution to this use case?
Thank you very much, I am using version 5.7.0
At the moment, I found one bad solution :
- add a ref in component
- change value in Vue object...
//set FR dropdown this.$refs.telInput[0]._props.allCountries[2].name = 'Algérie'; this.$refs.telInput[0]._props.allCountries[19].name = 'Belgique'; this.$refs.telInput[0]._props.allCountries[43].name = 'Chine'; this.$refs.telInput[0]._props.allCountries[79].name = 'Allemagne'; this.$refs.telInput[0]._props.allCountries[104].name = 'Italie'; this.$refs.telInput[0]._props.allCountries[144].name = 'Maroc'; this.$refs.telInput[0]._props.allCountries[150].name = 'Pays-Bas'; this.$refs.telInput[0]._props.allCountries[171].name = 'Portugal'; this.$refs.telInput[0]._props.allCountries[176].name = 'Russie'; this.$refs.telInput[0]._props.allCountries[202].name = 'Espagne'; this.$refs.telInput[0]._props.allCountries[209].name = 'Suisse'; this.$refs.telInput[0]._props.allCountries[229].name = 'Royaume-Uni';
@DurandSacha I did the same and I think that's the right way to go. In docs it says if you want to change countries then override allCountries
props.
I basically import database of dial codes and iso2, then I translate it to list of country names.