Skip to content

Commit

Permalink
refactor(locale): rename cz to cs_CZ (#2013)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmayer committed Apr 5, 2023
1 parent ea62046 commit a95fc51
Show file tree
Hide file tree
Showing 52 changed files with 34 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/guide/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
2 changes: 2 additions & 0 deletions docs/guide/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
13 changes: 13 additions & 0 deletions src/locale/cs_CZ.ts
Original file line number Diff line number Diff line change
@@ -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],
});
23 changes: 11 additions & 12 deletions src/locale/cz.ts
Original file line number Diff line number Diff line change
@@ -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;
})();
6 changes: 3 additions & 3 deletions src/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -71,7 +71,7 @@ export {
fakerAR,
fakerAZ,
fakerBASE,
fakerCZ,
fakerCS_CZ,
fakerDE,
fakerDE_AT,
fakerDE_CH,
Expand Down Expand Up @@ -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,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/locales/cz/index.ts → src/locales/cs_CZ/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -23,4 +23,4 @@ const cz: LocaleDefinition = {
phone_number,
};

export default cz;
export default cs_CZ;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { MetadataDefinitions } from '../..';

const metadata: MetadataDefinitions = {
title: 'Czech',
title: 'Czech (Czechia)',
};

export default metadata;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit a95fc51

Please sign in to comment.