Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(location)!: countryCode use ISO-3166-1 #1720

Merged
merged 3 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions src/definitions/location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export type LocationDefinitions = LocaleEntry<{
*/
country: string[];

/**
* The [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country codes.
*/
country_code: Array<{ alpha2: string; alpha3: string }>;

/**
* The names of this country's states.
*/
Expand Down Expand Up @@ -111,16 +116,6 @@ export type LocationDefinitions = LocaleEntry<{
*/
secondary_address: string[];

/**
* The ISO-3166-1 ALPHA-2 country codes related to this locale.
*/
country_code: string[];

/**
* The ISO-3166-1 ALPHA-3 country codes related to this locale.
*/
country_code_alpha_3: string[];

Shinigami92 marked this conversation as resolved.
Show resolved Hide resolved
/**
* A list of timezones names.
*/
Expand Down
11 changes: 10 additions & 1 deletion src/locales/de_CH/location/country_code.ts
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
export default ['CH', 'DE', 'AT', 'US', 'LI', 'HK', 'VN'];
// [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1)
export default [
{ alpha2: 'CH', alpha3: 'CHE' },
ST-DDT marked this conversation as resolved.
Show resolved Hide resolved
{ alpha2: 'DE', alpha3: 'DEU' },
{ alpha2: 'AT', alpha3: 'AUT' },
{ alpha2: 'US', alpha3: 'USA' },
{ alpha2: 'LI', alpha3: 'LIE' },
{ alpha2: 'HK', alpha3: 'HKG' },
{ alpha2: 'VN', alpha3: 'VNM' },
];
Loading