Skip to content

Commit

Permalink
Fix: static getCountryData missing country names. Closes #1628
Browse files Browse the repository at this point in the history
  • Loading branch information
jackocnr committed May 22, 2024
1 parent f6fa66a commit 6d98de9
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 2 deletions.
3 changes: 3 additions & 0 deletions build/js/intlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,9 @@ var factoryOutput = (() => {
var en_default = { ...countries_default, ...interface_default };

// src/js/intl-tel-input.ts
for (let i = 0; i < data_default.length; i++) {
data_default[i].name = en_default[data_default[i].iso2];
}
var id = 0;
var defaults = {
//* Whether or not to allow the dropdown.
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInput.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions build/js/intlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,9 @@ var factoryOutput = (() => {
var en_default = { ...countries_default, ...interface_default };

// src/js/intl-tel-input.ts
for (let i = 0; i < data_default.length; i++) {
data_default[i].name = en_default[data_default[i].iso2];
}
var id = 0;
var defaults = {
//* Whether or not to allow the dropdown.
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInputWithUtils.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions react/build/IntlTelInput.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,9 @@ var interface_default = {
var en_default = { ...countries_default, ...interface_default };

// src/js/intl-tel-input.ts
for (let i = 0; i < data_default.length; i++) {
data_default[i].name = en_default[data_default[i].iso2];
}
var id = 0;
var defaults = {
//* Whether or not to allow the dropdown.
Expand Down
3 changes: 3 additions & 0 deletions react/build/IntlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,9 @@ var interface_default = {
var en_default = { ...countries_default, ...interface_default };

// src/js/intl-tel-input.ts
for (let i = 0; i < data_default.length; i++) {
data_default[i].name = en_default[data_default[i].iso2];
}
var id = 0;
var defaults = {
//* Whether or not to allow the dropdown.
Expand Down
3 changes: 3 additions & 0 deletions react/build/IntlTelInputWithUtils.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,9 @@ var interface_default = {
var en_default = { ...countries_default, ...interface_default };

// src/js/intl-tel-input.ts
for (let i = 0; i < data_default.length; i++) {
data_default[i].name = en_default[data_default[i].iso2];
}
var id = 0;
var defaults = {
//* Whether or not to allow the dropdown.
Expand Down
3 changes: 3 additions & 0 deletions react/build/IntlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,9 @@ var interface_default = {
var en_default = { ...countries_default, ...interface_default };

// src/js/intl-tel-input.ts
for (let i = 0; i < data_default.length; i++) {
data_default[i].name = en_default[data_default[i].iso2];
}
var id = 0;
var defaults = {
//* Whether or not to allow the dropdown.
Expand Down
3 changes: 3 additions & 0 deletions react/demo/simple-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -24877,6 +24877,9 @@
var en_default = { ...countries_default, ...interface_default };

// src/js/intl-tel-input.ts
for (let i = 0; i < data_default.length; i++) {
data_default[i].name = en_default[data_default[i].iso2];
}
var id = 0;
var defaults = {
//* Whether or not to allow the dropdown.
Expand Down
3 changes: 3 additions & 0 deletions react/demo/validation-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -24877,6 +24877,9 @@
var en_default = { ...countries_default, ...interface_default };

// src/js/intl-tel-input.ts
for (let i = 0; i < data_default.length; i++) {
data_default[i].name = en_default[data_default[i].iso2];
}
var id = 0;
var defaults = {
//* Whether or not to allow the dropdown.
Expand Down
5 changes: 5 additions & 0 deletions src/js/intl-tel-input.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import allCountries, { Country } from "./intl-tel-input/data";
import defaultEnglishStrings from "./i18n/en";

//* Populate the country names in the default language - useful if you want to use static getCountryData to populate another country dropdown etc.
for (let i = 0; i < allCountries.length; i++) {
allCountries[i].name = defaultEnglishStrings[allCountries[i].iso2];
}

interface IntlTelInputInterface {
(input: HTMLInputElement, options?: SomeOptions): Iti;
autoCountry?: string;
Expand Down

0 comments on commit 6d98de9

Please sign in to comment.