mrmarkfrench / country-select-js

A quick jQuery-based country picker based on https://github.com/Bluefieldscom/intl-tel-input.git
MIT License
282 stars 105 forks source link

Added basic support for i18n #87

Closed PascalBergeron1993 closed 3 years ago

PascalBergeron1993 commented 3 years ago

This pull request addresses the issue #86

The support for i18n is taken directly from intl-tel-input. They have a localizedCountries object, which is described as such:

Type: Object Default: {} Allows to translate the countries by its given iso code e.g.: { 'de': 'Deutschland' }

This object is very basic in its i18n support, but it seems to have been serving the users of intl-tel-input fine so far. It surely is meeting my needs (both as a user of intl-tel-input and country-select-js) so I think it would be a good idea to add localizedCountries into country-select-js. I've also imported code from intl-tel-input so that the country array is automatically sorted.

Let me know your thoughts.

Also, please note this is my first ever pull request. I hope I have done it correctly, but I can't offer any guarantees.