diff --git a/docs/guide/localization.md b/docs/guide/localization.md index acf4cdd1b75..dcfd7ce35c7 100644 --- a/docs/guide/localization.md +++ b/docs/guide/localization.md @@ -78,7 +78,7 @@ In this example there are 5 locales. Each of these is checked in order, and the | `ar` | Arabic | `fakerAR` | | `az` | Azerbaijani | `fakerAZ` | | `base` | Base | `fakerBASE` | -| `cz` | Czech | `fakerCZ` | +| `cs_CZ` | Czech (Czechia) | `fakerCS_CZ` | | `de` | German | `fakerDE` | | `de_AT` | German (Austria) | `fakerDE_AT` | | `de_CH` | German (Switzerland) | `fakerDE_CH` | diff --git a/docs/guide/upgrading.md b/docs/guide/upgrading.md index 38b6e6a4c8d..555c267ca28 100644 --- a/docs/guide/upgrading.md +++ b/docs/guide/upgrading.md @@ -225,4 +225,6 @@ Please have a look at issue [#1785](https://github.com/faker-js/faker/issues/178 The `en_IND` (English, India) locale was renamed to `en_IN` for consistency with other locales. +The `cz` (Czech) locale was renamed to `cs_CZ` to use the standard ISO codes for language and country. + The `ge` (Georgian) locale was renamed to `ka_GE` to use the standard ISO codes for language and country. diff --git a/src/locale/cs_CZ.ts b/src/locale/cs_CZ.ts new file mode 100644 index 00000000000..4e56c6d410c --- /dev/null +++ b/src/locale/cs_CZ.ts @@ -0,0 +1,13 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ + +import { Faker } from '../faker'; +import base from '../locales/base'; +import cs_CZ from '../locales/cs_CZ'; +import en from '../locales/en'; + +export const faker = new Faker({ + locale: [cs_CZ, en, base], +}); diff --git a/src/locale/cz.ts b/src/locale/cz.ts index 19b35d71f91..f7227d82d5b 100644 --- a/src/locale/cz.ts +++ b/src/locale/cz.ts @@ -1,13 +1,12 @@ -/* - * This file is automatically generated. - * Run 'pnpm run generate:locales' to update. - */ +import { deprecated } from '../internal/deprecated'; +import { faker as cs_CZ } from './cs_CZ'; -import { Faker } from '../faker'; -import base from '../locales/base'; -import cz from '../locales/cz'; -import en from '../locales/en'; - -export const faker = new Faker({ - locale: [cz, en, base], -}); +export const faker = (() => { + deprecated({ + deprecated: "import { faker } from '@faker-js/faker/locale/cz'", + proposed: "import { faker } from '@faker-js/faker/locale/cs_CZ'", + since: '8.0', + until: '9.0', + }); + return cs_CZ; +})(); diff --git a/src/locale/index.ts b/src/locale/index.ts index f5b7653f8c0..8772dca61b1 100644 --- a/src/locale/index.ts +++ b/src/locale/index.ts @@ -7,7 +7,7 @@ import { faker as fakerAF_ZA } from './af_ZA'; import { faker as fakerAR } from './ar'; import { faker as fakerAZ } from './az'; import { faker as fakerBASE } from './base'; -import { faker as fakerCZ } from './cz'; +import { faker as fakerCS_CZ } from './cs_CZ'; import { faker as fakerDE } from './de'; import { faker as fakerDE_AT } from './de_AT'; import { faker as fakerDE_CH } from './de_CH'; @@ -71,7 +71,7 @@ export { fakerAR, fakerAZ, fakerBASE, - fakerCZ, + fakerCS_CZ, fakerDE, fakerDE_AT, fakerDE_CH, @@ -136,7 +136,7 @@ export const allFakers = { ar: fakerAR, az: fakerAZ, base: fakerBASE, - cz: fakerCZ, + cs_CZ: fakerCS_CZ, de: fakerDE, de_AT: fakerDE_AT, de_CH: fakerDE_CH, diff --git a/src/locales/cz/company/adjective.ts b/src/locales/cs_CZ/company/adjective.ts similarity index 100% rename from src/locales/cz/company/adjective.ts rename to src/locales/cs_CZ/company/adjective.ts diff --git a/src/locales/cz/company/descriptor.ts b/src/locales/cs_CZ/company/descriptor.ts similarity index 100% rename from src/locales/cz/company/descriptor.ts rename to src/locales/cs_CZ/company/descriptor.ts diff --git a/src/locales/cz/company/index.ts b/src/locales/cs_CZ/company/index.ts similarity index 100% rename from src/locales/cz/company/index.ts rename to src/locales/cs_CZ/company/index.ts diff --git a/src/locales/cz/company/name_patterns.ts b/src/locales/cs_CZ/company/name_patterns.ts similarity index 100% rename from src/locales/cz/company/name_patterns.ts rename to src/locales/cs_CZ/company/name_patterns.ts diff --git a/src/locales/cz/company/noun.ts b/src/locales/cs_CZ/company/noun.ts similarity index 100% rename from src/locales/cz/company/noun.ts rename to src/locales/cs_CZ/company/noun.ts diff --git a/src/locales/cz/company/suffix.ts b/src/locales/cs_CZ/company/suffix.ts similarity index 100% rename from src/locales/cz/company/suffix.ts rename to src/locales/cs_CZ/company/suffix.ts diff --git a/src/locales/cz/date/index.ts b/src/locales/cs_CZ/date/index.ts similarity index 100% rename from src/locales/cz/date/index.ts rename to src/locales/cs_CZ/date/index.ts diff --git a/src/locales/cz/date/month.ts b/src/locales/cs_CZ/date/month.ts similarity index 100% rename from src/locales/cz/date/month.ts rename to src/locales/cs_CZ/date/month.ts diff --git a/src/locales/cz/date/weekday.ts b/src/locales/cs_CZ/date/weekday.ts similarity index 100% rename from src/locales/cz/date/weekday.ts rename to src/locales/cs_CZ/date/weekday.ts diff --git a/src/locales/cz/index.ts b/src/locales/cs_CZ/index.ts similarity index 90% rename from src/locales/cz/index.ts rename to src/locales/cs_CZ/index.ts index 28f0a84b410..c3770c00b37 100644 --- a/src/locales/cz/index.ts +++ b/src/locales/cs_CZ/index.ts @@ -12,7 +12,7 @@ import metadata from './metadata'; import person from './person'; import phone_number from './phone_number'; -const cz: LocaleDefinition = { +const cs_CZ: LocaleDefinition = { company, date, internet, @@ -23,4 +23,4 @@ const cz: LocaleDefinition = { phone_number, }; -export default cz; +export default cs_CZ; diff --git a/src/locales/cz/internet/domain_suffix.ts b/src/locales/cs_CZ/internet/domain_suffix.ts similarity index 100% rename from src/locales/cz/internet/domain_suffix.ts rename to src/locales/cs_CZ/internet/domain_suffix.ts diff --git a/src/locales/cz/internet/free_email.ts b/src/locales/cs_CZ/internet/free_email.ts similarity index 100% rename from src/locales/cz/internet/free_email.ts rename to src/locales/cs_CZ/internet/free_email.ts diff --git a/src/locales/cz/internet/index.ts b/src/locales/cs_CZ/internet/index.ts similarity index 100% rename from src/locales/cz/internet/index.ts rename to src/locales/cs_CZ/internet/index.ts diff --git a/src/locales/cz/location/building_number.ts b/src/locales/cs_CZ/location/building_number.ts similarity index 100% rename from src/locales/cz/location/building_number.ts rename to src/locales/cs_CZ/location/building_number.ts diff --git a/src/locales/cz/location/city.ts b/src/locales/cs_CZ/location/city.ts similarity index 100% rename from src/locales/cz/location/city.ts rename to src/locales/cs_CZ/location/city.ts diff --git a/src/locales/cz/location/city_name.ts b/src/locales/cs_CZ/location/city_name.ts similarity index 100% rename from src/locales/cz/location/city_name.ts rename to src/locales/cs_CZ/location/city_name.ts diff --git a/src/locales/cz/location/country.ts b/src/locales/cs_CZ/location/country.ts similarity index 100% rename from src/locales/cz/location/country.ts rename to src/locales/cs_CZ/location/country.ts diff --git a/src/locales/cz/location/default_country.ts b/src/locales/cs_CZ/location/default_country.ts similarity index 100% rename from src/locales/cz/location/default_country.ts rename to src/locales/cs_CZ/location/default_country.ts diff --git a/src/locales/cz/location/index.ts b/src/locales/cs_CZ/location/index.ts similarity index 100% rename from src/locales/cz/location/index.ts rename to src/locales/cs_CZ/location/index.ts diff --git a/src/locales/cz/location/postcode.ts b/src/locales/cs_CZ/location/postcode.ts similarity index 100% rename from src/locales/cz/location/postcode.ts rename to src/locales/cs_CZ/location/postcode.ts diff --git a/src/locales/cz/location/secondary_address.ts b/src/locales/cs_CZ/location/secondary_address.ts similarity index 100% rename from src/locales/cz/location/secondary_address.ts rename to src/locales/cs_CZ/location/secondary_address.ts diff --git a/src/locales/cz/location/state.ts b/src/locales/cs_CZ/location/state.ts similarity index 100% rename from src/locales/cz/location/state.ts rename to src/locales/cs_CZ/location/state.ts diff --git a/src/locales/cz/location/state_abbr.ts b/src/locales/cs_CZ/location/state_abbr.ts similarity index 100% rename from src/locales/cz/location/state_abbr.ts rename to src/locales/cs_CZ/location/state_abbr.ts diff --git a/src/locales/cz/location/street.ts b/src/locales/cs_CZ/location/street.ts similarity index 100% rename from src/locales/cz/location/street.ts rename to src/locales/cs_CZ/location/street.ts diff --git a/src/locales/cz/location/street_address.ts b/src/locales/cs_CZ/location/street_address.ts similarity index 100% rename from src/locales/cz/location/street_address.ts rename to src/locales/cs_CZ/location/street_address.ts diff --git a/src/locales/cz/location/street_name.ts b/src/locales/cs_CZ/location/street_name.ts similarity index 100% rename from src/locales/cz/location/street_name.ts rename to src/locales/cs_CZ/location/street_name.ts diff --git a/src/locales/cz/lorem/index.ts b/src/locales/cs_CZ/lorem/index.ts similarity index 100% rename from src/locales/cz/lorem/index.ts rename to src/locales/cs_CZ/lorem/index.ts diff --git a/src/locales/cz/lorem/words.ts b/src/locales/cs_CZ/lorem/words.ts similarity index 100% rename from src/locales/cz/lorem/words.ts rename to src/locales/cs_CZ/lorem/words.ts diff --git a/src/locales/cz/metadata.ts b/src/locales/cs_CZ/metadata.ts similarity index 81% rename from src/locales/cz/metadata.ts rename to src/locales/cs_CZ/metadata.ts index af6a36bc82f..98ab47df586 100644 --- a/src/locales/cz/metadata.ts +++ b/src/locales/cs_CZ/metadata.ts @@ -1,7 +1,7 @@ import type { MetadataDefinitions } from '../..'; const metadata: MetadataDefinitions = { - title: 'Czech', + title: 'Czech (Czechia)', }; export default metadata; diff --git a/src/locales/cz/person/female_first_name.ts b/src/locales/cs_CZ/person/female_first_name.ts similarity index 100% rename from src/locales/cz/person/female_first_name.ts rename to src/locales/cs_CZ/person/female_first_name.ts diff --git a/src/locales/cz/person/female_last_name.ts b/src/locales/cs_CZ/person/female_last_name.ts similarity index 100% rename from src/locales/cz/person/female_last_name.ts rename to src/locales/cs_CZ/person/female_last_name.ts diff --git a/src/locales/cz/person/female_last_name_patterns.ts b/src/locales/cs_CZ/person/female_last_name_patterns.ts similarity index 100% rename from src/locales/cz/person/female_last_name_patterns.ts rename to src/locales/cs_CZ/person/female_last_name_patterns.ts diff --git a/src/locales/cz/person/female_prefix.ts b/src/locales/cs_CZ/person/female_prefix.ts similarity index 100% rename from src/locales/cz/person/female_prefix.ts rename to src/locales/cs_CZ/person/female_prefix.ts diff --git a/src/locales/cz/person/first_name.ts b/src/locales/cs_CZ/person/first_name.ts similarity index 100% rename from src/locales/cz/person/first_name.ts rename to src/locales/cs_CZ/person/first_name.ts diff --git a/src/locales/cz/person/index.ts b/src/locales/cs_CZ/person/index.ts similarity index 100% rename from src/locales/cz/person/index.ts rename to src/locales/cs_CZ/person/index.ts diff --git a/src/locales/cz/person/last_name.ts b/src/locales/cs_CZ/person/last_name.ts similarity index 100% rename from src/locales/cz/person/last_name.ts rename to src/locales/cs_CZ/person/last_name.ts diff --git a/src/locales/cz/person/male_first_name.ts b/src/locales/cs_CZ/person/male_first_name.ts similarity index 100% rename from src/locales/cz/person/male_first_name.ts rename to src/locales/cs_CZ/person/male_first_name.ts diff --git a/src/locales/cz/person/male_last_name.ts b/src/locales/cs_CZ/person/male_last_name.ts similarity index 100% rename from src/locales/cz/person/male_last_name.ts rename to src/locales/cs_CZ/person/male_last_name.ts diff --git a/src/locales/cz/person/male_last_name_patterns.ts b/src/locales/cs_CZ/person/male_last_name_patterns.ts similarity index 100% rename from src/locales/cz/person/male_last_name_patterns.ts rename to src/locales/cs_CZ/person/male_last_name_patterns.ts diff --git a/src/locales/cz/person/male_prefix.ts b/src/locales/cs_CZ/person/male_prefix.ts similarity index 100% rename from src/locales/cz/person/male_prefix.ts rename to src/locales/cs_CZ/person/male_prefix.ts diff --git a/src/locales/cz/person/name.ts b/src/locales/cs_CZ/person/name.ts similarity index 100% rename from src/locales/cz/person/name.ts rename to src/locales/cs_CZ/person/name.ts diff --git a/src/locales/cz/person/prefix.ts b/src/locales/cs_CZ/person/prefix.ts similarity index 100% rename from src/locales/cz/person/prefix.ts rename to src/locales/cs_CZ/person/prefix.ts diff --git a/src/locales/cz/person/suffix.ts b/src/locales/cs_CZ/person/suffix.ts similarity index 100% rename from src/locales/cz/person/suffix.ts rename to src/locales/cs_CZ/person/suffix.ts diff --git a/src/locales/cz/person/title.ts b/src/locales/cs_CZ/person/title.ts similarity index 100% rename from src/locales/cz/person/title.ts rename to src/locales/cs_CZ/person/title.ts diff --git a/src/locales/cz/phone_number/formats.ts b/src/locales/cs_CZ/phone_number/formats.ts similarity index 100% rename from src/locales/cz/phone_number/formats.ts rename to src/locales/cs_CZ/phone_number/formats.ts diff --git a/src/locales/cz/phone_number/index.ts b/src/locales/cs_CZ/phone_number/index.ts similarity index 100% rename from src/locales/cz/phone_number/index.ts rename to src/locales/cs_CZ/phone_number/index.ts diff --git a/src/locales/index.ts b/src/locales/index.ts index fa5ea18a358..b0f87395451 100644 --- a/src/locales/index.ts +++ b/src/locales/index.ts @@ -7,7 +7,7 @@ export { default as af_ZA } from './af_ZA'; export { default as ar } from './ar'; export { default as az } from './az'; export { default as base } from './base'; -export { default as cz } from './cz'; +export { default as cs_CZ } from './cs_CZ'; export { default as de } from './de'; export { default as de_AT } from './de_AT'; export { default as de_CH } from './de_CH';