Skip to content

Commit

Permalink
refactor(locale): rename company affix files (#2975)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored Jun 26, 2024
1 parent 8134b33 commit 49d7119
Show file tree
Hide file tree
Showing 116 changed files with 161 additions and 170 deletions.
15 changes: 15 additions & 0 deletions docs/guide/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,21 @@ Removed deprecated company methods
| `faker.company.bsBuzz` | `faker.company.buzzVerb` |
| `faker.company.bsNoun` | `faker.company.buzzNoun` |

#### Company Name Affix files reorganized

The company name affix files have been used inconsistently.
Sometimes `suffix`es were used as prefixes in the patterns, because they contained legal entity types (and in English these were defined as `suffix`es).
We renamed the files to match their actual content instead of their hypothetical position.
If you are using the public methods, no changes are required.
You only need to change your code if you are accessing the raw definitions e.g. in `faker.helpers.fake()`.

| Before | After |
| ------------------------- | -------------------------------------- |
| `location.company.prefix` | `location.company.category` |
| `location.company.suffix` | `location.direction.legal_entity_type` |

Note: In some locales `prefix`es and `suffix`es might have been swapped, so the mapping might be wrong for those.

### Datatype Module

Removed deprecated datatype methods
Expand Down
4 changes: 2 additions & 2 deletions src/locales/af_ZA/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import suffix from './suffix';
import legal_entity_type from './legal_entity_type';

const company: CompanyDefinition = {
suffix,
legal_entity_type,
};

export default company;
File renamed without changes.
6 changes: 2 additions & 4 deletions src/locales/az/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import legal_entity_type from './legal_entity_type';
import name_pattern from './name_pattern';
import prefix from './prefix';
import suffix from './suffix';

const company: CompanyDefinition = {
legal_entity_type,
name_pattern,
prefix,
suffix,
};

export default company;
File renamed without changes.
6 changes: 3 additions & 3 deletions src/locales/az/company/name_pattern.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default [
'{{company.prefix}} {{person.female_first_name}}',
'{{company.prefix}} {{person.male_first_name}}',
'{{company.prefix}} {{person.male_last_name}}',
'{{company.legal_entity_type}} {{person.female_first_name}}',
'{{company.legal_entity_type}} {{person.male_first_name}}',
'{{company.legal_entity_type}} {{person.male_last_name}}',
];
1 change: 0 additions & 1 deletion src/locales/az/company/suffix.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/locales/cs_CZ/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import legal_entity_type from './legal_entity_type';
import name_pattern from './name_pattern';
import suffix from './suffix';

const company: CompanyDefinition = {
legal_entity_type,
name_pattern,
suffix,
};

export default company;
File renamed without changes.
4 changes: 2 additions & 2 deletions src/locales/cs_CZ/company/name_pattern.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default [
'{{person.last_name}} {{company.suffix}}',
'{{person.male_last_name}} a {{person.male_last_name}} {{company.suffix}}',
'{{person.last_name}} {{company.legal_entity_type}}',
'{{person.male_last_name}} a {{person.male_last_name}} {{company.legal_entity_type}}',
];
4 changes: 2 additions & 2 deletions src/locales/da/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import buzz_noun from './buzz_noun';
import buzz_verb from './buzz_verb';
import company_name from './company_name';
import descriptor from './descriptor';
import legal_entity_type from './legal_entity_type';
import name_pattern from './name_pattern';
import noun from './noun';
import suffix from './suffix';

const company: CompanyDefinition = {
adjective,
Expand All @@ -20,9 +20,9 @@ const company: CompanyDefinition = {
buzz_verb,
company_name,
descriptor,
legal_entity_type,
name_pattern,
noun,
suffix,
};

export default company;
File renamed without changes.
2 changes: 1 addition & 1 deletion src/locales/da/company/name_pattern.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default [
'{{company.company_name}}',
'{{person.last_name}} {{commerce.department}} {{company.suffix}}',
'{{person.last_name}} {{commerce.department}} {{company.legal_entity_type}}',
];
6 changes: 2 additions & 4 deletions src/locales/de/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import legal_form from './legal_form';
import legal_entity_type from './legal_entity_type';
import name_pattern from './name_pattern';
import suffix from './suffix';

const company: CompanyDefinition = {
legal_form,
legal_entity_type,
name_pattern,
suffix,
};

export default company;
File renamed without changes.
2 changes: 1 addition & 1 deletion src/locales/de/company/name_pattern.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default [
'{{person.last_name}} {{company.suffix}}',
'{{person.last_name}} {{company.legal_entity_type}}',
'{{person.last_name}}, {{person.last_name}} und {{person.last_name}}',
'{{person.last_name}}-{{person.last_name}}',
];
6 changes: 2 additions & 4 deletions src/locales/de_AT/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import legal_form from './legal_form';
import legal_entity_type from './legal_entity_type';
import name_pattern from './name_pattern';
import suffix from './suffix';

const company: CompanyDefinition = {
legal_form,
legal_entity_type,
name_pattern,
suffix,
};

export default company;
File renamed without changes.
1 change: 0 additions & 1 deletion src/locales/de_AT/company/legal_form.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/locales/de_AT/company/name_pattern.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default [
'{{person.last_name}} {{company.suffix}}',
'{{person.last_name}} {{company.legal_entity_type}}',
'{{person.last_name}}, {{person.last_name}} und {{person.last_name}}',
'{{person.last_name}}-{{person.last_name}}',
];
1 change: 0 additions & 1 deletion src/locales/de_AT/company/suffix.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/locales/de_CH/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import legal_entity_type from './legal_entity_type';
import name_pattern from './name_pattern';
import suffix from './suffix';

const company: CompanyDefinition = {
legal_entity_type,
name_pattern,
suffix,
};

export default company;
File renamed without changes.
2 changes: 1 addition & 1 deletion src/locales/de_CH/company/name_pattern.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default [
'{{person.last_name}} {{company.suffix}}',
'{{person.last_name}} {{company.legal_entity_type}}',
'{{person.last_name}}, {{person.last_name}} und {{person.last_name}}',
'{{person.last_name}}-{{person.last_name}}',
];
4 changes: 2 additions & 2 deletions src/locales/dv/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
*/
import type { CompanyDefinition } from '../../..';
import adjective from './adjective';
import legal_entity_type from './legal_entity_type';
import name_pattern from './name_pattern';
import noun from './noun';
import suffix from './suffix';

const company: CompanyDefinition = {
adjective,
legal_entity_type,
name_pattern,
noun,
suffix,
};

export default company;
File renamed without changes.
10 changes: 5 additions & 5 deletions src/locales/dv/company/name_pattern.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default [
'{{company.adjective}} {{company.noun}} {{company.suffix}}',
'{{company.adjective}} {{person.last_name}} {{person.last_name}} {{company.suffix}}',
'{{person.first_name}} {{company.suffix}}',
'{{person.last_name}} & {{person.last_name}} {{company.noun}} {{company.suffix}}',
'{{person.last_name}} {{company.suffix}}',
'{{company.adjective}} {{company.noun}} {{company.legal_entity_type}}',
'{{company.adjective}} {{person.last_name}} {{person.last_name}} {{company.legal_entity_type}}',
'{{person.first_name}} {{company.legal_entity_type}}',
'{{person.last_name}} & {{person.last_name}} {{company.noun}} {{company.legal_entity_type}}',
'{{person.last_name}} {{company.legal_entity_type}}',
];
4 changes: 2 additions & 2 deletions src/locales/el/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import buzz_adjective from './buzz_adjective';
import buzz_noun from './buzz_noun';
import buzz_verb from './buzz_verb';
import descriptor from './descriptor';
import legal_entity_type from './legal_entity_type';
import name_pattern from './name_pattern';
import noun from './noun';
import suffix from './suffix';

const company: CompanyDefinition = {
adjective,
buzz_adjective,
buzz_noun,
buzz_verb,
descriptor,
legal_entity_type,
name_pattern,
noun,
suffix,
};

export default company;
File renamed without changes.
2 changes: 1 addition & 1 deletion src/locales/el/company/name_pattern.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default [
'{{person.last_name}} {{company.suffix}}',
'{{person.last_name}} {{company.legal_entity_type}}',
'{{person.last_name}}, {{person.last_name}} and {{person.last_name}}',
'{{person.last_name}}-{{person.last_name}}',
];
4 changes: 2 additions & 2 deletions src/locales/en/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import buzz_adjective from './buzz_adjective';
import buzz_noun from './buzz_noun';
import buzz_verb from './buzz_verb';
import descriptor from './descriptor';
import legal_entity_type from './legal_entity_type';
import name_pattern from './name_pattern';
import noun from './noun';
import suffix from './suffix';

const company: CompanyDefinition = {
adjective,
buzz_adjective,
buzz_noun,
buzz_verb,
descriptor,
legal_entity_type,
name_pattern,
noun,
suffix,
};

export default company;
File renamed without changes.
2 changes: 1 addition & 1 deletion src/locales/en/company/name_pattern.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default [
'{{person.last_name}} - {{person.last_name}}',
'{{person.last_name}} {{company.suffix}}',
'{{person.last_name}} {{company.legal_entity_type}}',
'{{person.last_name}}, {{person.last_name}} and {{person.last_name}}',
];
4 changes: 2 additions & 2 deletions src/locales/en_AU/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import suffix from './suffix';
import legal_entity_type from './legal_entity_type';

const company: CompanyDefinition = {
suffix,
legal_entity_type,
};

export default company;
File renamed without changes.
12 changes: 0 additions & 12 deletions src/locales/en_AU_ocker/company/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/locales/en_AU_ocker/company/suffix.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/locales/en_AU_ocker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { LocaleDefinition } from '../..';
import company from './company';
import internet from './internet';
import location from './location';
import metadata from './metadata';
import person from './person';
import phone_number from './phone_number';

const en_AU_ocker: LocaleDefinition = {
company,
internet,
location,
metadata,
Expand Down
4 changes: 2 additions & 2 deletions src/locales/en_GH/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import legal_entity_type from './legal_entity_type';
import name_pattern from './name_pattern';
import suffix from './suffix';

const company: CompanyDefinition = {
legal_entity_type,
name_pattern,
suffix,
};

export default company;
File renamed without changes.
2 changes: 1 addition & 1 deletion src/locales/en_GH/company/name_pattern.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default [
'{{person.last_name}} and {{person.last_name}}',
'{{person.last_name}} {{company.suffix}}',
'{{person.last_name}} {{company.legal_entity_type}}',
];
4 changes: 2 additions & 2 deletions src/locales/en_HK/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import suffix from './suffix';
import legal_entity_type from './legal_entity_type';

const company: CompanyDefinition = {
suffix,
legal_entity_type,
};

export default company;
File renamed without changes.
4 changes: 2 additions & 2 deletions src/locales/en_IN/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import suffix from './suffix';
import legal_entity_type from './legal_entity_type';

const company: CompanyDefinition = {
suffix,
legal_entity_type,
};

export default company;
File renamed without changes.
4 changes: 2 additions & 2 deletions src/locales/en_NG/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import suffix from './suffix';
import legal_entity_type from './legal_entity_type';

const company: CompanyDefinition = {
suffix,
legal_entity_type,
};

export default company;
File renamed without changes.
4 changes: 2 additions & 2 deletions src/locales/en_ZA/company/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Run 'pnpm run generate:locales' to update.
*/
import type { CompanyDefinition } from '../../..';
import suffix from './suffix';
import legal_entity_type from './legal_entity_type';

const company: CompanyDefinition = {
suffix,
legal_entity_type,
};

export default company;
File renamed without changes.
Loading

0 comments on commit 49d7119

Please sign in to comment.