Skip to content

Commit

Permalink
refactor(location)!: countryCode use ISO-3166-1 (#1720)
Browse files Browse the repository at this point in the history
Co-authored-by: Shinigami92 <chrissi92@hotmail.de>
  • Loading branch information
xDivisionByZerox and Shinigami92 committed Feb 20, 2023
1 parent 0eba320 commit a05c3e5
Show file tree
Hide file tree
Showing 8 changed files with 276 additions and 524 deletions.
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[];

/**
* 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' },
{ alpha2: 'DE', alpha3: 'DEU' },
{ alpha2: 'AT', alpha3: 'AUT' },
{ alpha2: 'US', alpha3: 'USA' },
{ alpha2: 'LI', alpha3: 'LIE' },
{ alpha2: 'HK', alpha3: 'HKG' },
{ alpha2: 'VN', alpha3: 'VNM' },
];

0 comments on commit a05c3e5

Please sign in to comment.