Skip to content

Commit

Permalink
Changes according to repo owner
Browse files Browse the repository at this point in the history
  • Loading branch information
elonmir committed Jun 12, 2018
1 parent a1d2be0 commit 0a8010f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Type: `Object` Default: `{}`
Allows to translate the countries by its given iso code e.g.:

```js
{'DE':'Deutschland'}
{'de':'Deutschland'}
```


Expand Down
10 changes: 6 additions & 4 deletions build/js/intlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
separateDialCode: false,
// specify the path to the libphonenumber script to enable validation/formatting
utilsScript: "",
// default locale eg.: {'DE':'Deutschland'}
localizedCountries: {}
// default locale eg.: {'de':'Deutschland'}
localizedCountries: null
}, keys = {
UP: 38,
DOWN: 40,
Expand Down Expand Up @@ -133,7 +133,9 @@
// process the preferredCountries
this._processPreferredCountries();
// translate countries according to locale object literal
this._translateCountriesByLocale();
if (this.options.localizedCountries) {
this._translateCountriesByLocale();
}
},
// add a country code to this.countryCodes
_addCountryCode: function(iso2, dialCode, priority) {
Expand Down Expand Up @@ -166,7 +168,7 @@
// Translate Countries by object literal provided on config
_translateCountriesByLocale: function() {
for (var i = 0; i < this.countries.length; i++) {
var iso = this.countries[i].iso2.toUpperCase();
var iso = this.countries[i].iso2.toLowerCase();
if (iso in this.options.localizedCountries) {
this.countries[i].name = this.options.localizedCountries[iso];
}
Expand Down
Loading

0 comments on commit 0a8010f

Please sign in to comment.