Skip to content

Commit 0bc6c2f

Browse files
authored
refactor(locale)!: remove unused separator entry (#1731)
1 parent 6772b00 commit 0bc6c2f

16 files changed

Lines changed: 3 additions & 37 deletions

File tree

scripts/generateLocales.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function tryLoadLocalesMainIndexFile(pathModules: string): LocaleDefinition {
132132
let localeDef: LocaleDefinition;
133133
// This call might fail, if the module setup is broken.
134134
// Unfortunately, we try to fix it with this script
135-
// Thats why have a fallback logic here, we only need the title and separator anyway
135+
// Thats why have a fallback logic here, we only need the title anyway
136136
try {
137137
// eslint-disable-next-line @typescript-eslint/no-var-requires
138138
localeDef = require(pathModules).default;
@@ -147,7 +147,6 @@ function tryLoadLocalesMainIndexFile(pathModules: string): LocaleDefinition {
147147
);
148148
localeDef = {
149149
title: localeIndex.match(/title: '(.*)',/)[1],
150-
separator: localeIndex.match(/separator: '(.*)',/)?.[1],
151150
};
152151
} catch {
153152
console.error(`Failed to load ${pathModules} or manually parse it.`, e);
@@ -287,7 +286,6 @@ for (const locale of locales) {
287286
const localeDef = tryLoadLocalesMainIndexFile(pathModules);
288287
// We use a fallback here to at least generate a working file.
289288
const localeTitle = localeDef?.title ?? `TODO: Insert Title for ${locale}`;
290-
const localeSeparator = localeDef?.separator;
291289

292290
localeIndexImports += `import ${locale} from './${locale}';\n`;
293291
localeIndexType += ` | '${locale}'\n`;
@@ -298,14 +296,12 @@ for (const locale of locales) {
298296
generateLocaleFile(locale);
299297

300298
// src/locales/**/index.ts
301-
const separator = localeSeparator ? `\nseparator: '${localeSeparator}',` : '';
302-
303299
generateRecursiveModuleIndexes(
304300
pathModules,
305301
locale,
306302
'LocaleDefinition',
307303
1,
308-
`title: '${localeTitle}',${separator}`
304+
`title: '${localeTitle}',`
309305
);
310306
}
311307

src/definitions/definitions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,4 @@ export type LocaleDefinition = {
5656
* The name of the language.
5757
*/
5858
title: string;
59-
separator?: string;
6059
} & LocaleEntry<Definitions>;

src/faker.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ export interface FakerOptions {
4242
localeFallback?: UsableLocale;
4343
}
4444

45-
const metadataKeys: ReadonlyArray<keyof LocaleDefinition> = [
46-
'title',
47-
'separator',
48-
];
45+
const metadataKeys: ReadonlyArray<keyof LocaleDefinition> = ['title'];
4946

5047
export class Faker {
5148
locales: UsedLocales;

src/locales/ar/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import vehicle from './vehicle';
1515

1616
const ar: LocaleDefinition = {
1717
title: 'Arabic',
18-
separator: ' & ',
1918
cell_phone,
2019
color,
2120
commerce,

src/locales/az/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import phone_number from './phone_number';
1414

1515
const az: LocaleDefinition = {
1616
title: 'Azerbaijani',
17-
separator: ' və ',
1817
color,
1918
commerce,
2019
company,

src/locales/el/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import team from './team';
2020

2121
const el: LocaleDefinition = {
2222
title: 'Greek',
23-
separator: ' & ',
2423
app,
2524
business,
2625
cell_phone,

src/locales/en/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import word from './word';
2828

2929
const en: LocaleDefinition = {
3030
title: 'English',
31-
separator: ' & ',
3231
animal,
3332
app,
3433
business,

src/locales/es_MX/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import team from './team';
1616

1717
const es_MX: LocaleDefinition = {
1818
title: 'Spanish (Mexico)',
19-
separator: ' & ',
2019
cell_phone,
2120
color,
2221
commerce,

src/locales/ge/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import phone_number from './phone_number';
1212

1313
const ge: LocaleDefinition = {
1414
title: 'Georgian',
15-
separator: ' და ',
1615
cell_phone,
1716
company,
1817
internet,

src/locales/he/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import phone_number from './phone_number';
1515

1616
const he: LocaleDefinition = {
1717
title: 'Hebrew',
18-
separator: 'ו ',
1918
cell_phone,
2019
color,
2120
commerce,

0 commit comments

Comments
 (0)