diff --git a/scripts/generateLocales.ts b/scripts/generateLocales.ts index 07cf47e7576..ce7bce60f9b 100644 --- a/scripts/generateLocales.ts +++ b/scripts/generateLocales.ts @@ -132,7 +132,7 @@ function tryLoadLocalesMainIndexFile(pathModules: string): LocaleDefinition { let localeDef: LocaleDefinition; // This call might fail, if the module setup is broken. // Unfortunately, we try to fix it with this script - // Thats why have a fallback logic here, we only need the title and separator anyway + // Thats why have a fallback logic here, we only need the title anyway try { // eslint-disable-next-line @typescript-eslint/no-var-requires localeDef = require(pathModules).default; @@ -147,7 +147,6 @@ function tryLoadLocalesMainIndexFile(pathModules: string): LocaleDefinition { ); localeDef = { title: localeIndex.match(/title: '(.*)',/)[1], - separator: localeIndex.match(/separator: '(.*)',/)?.[1], }; } catch { console.error(`Failed to load ${pathModules} or manually parse it.`, e); @@ -287,7 +286,6 @@ for (const locale of locales) { const localeDef = tryLoadLocalesMainIndexFile(pathModules); // We use a fallback here to at least generate a working file. const localeTitle = localeDef?.title ?? `TODO: Insert Title for ${locale}`; - const localeSeparator = localeDef?.separator; localeIndexImports += `import ${locale} from './${locale}';\n`; localeIndexType += ` | '${locale}'\n`; @@ -298,14 +296,12 @@ for (const locale of locales) { generateLocaleFile(locale); // src/locales/**/index.ts - const separator = localeSeparator ? `\nseparator: '${localeSeparator}',` : ''; - generateRecursiveModuleIndexes( pathModules, locale, 'LocaleDefinition', 1, - `title: '${localeTitle}',${separator}` + `title: '${localeTitle}',` ); } diff --git a/src/definitions/definitions.ts b/src/definitions/definitions.ts index 59c133eb77b..b4afae1baf5 100644 --- a/src/definitions/definitions.ts +++ b/src/definitions/definitions.ts @@ -56,5 +56,4 @@ export type LocaleDefinition = { * The name of the language. */ title: string; - separator?: string; } & LocaleEntry; diff --git a/src/faker.ts b/src/faker.ts index 7224c501d31..dadb79dfd34 100644 --- a/src/faker.ts +++ b/src/faker.ts @@ -42,10 +42,7 @@ export interface FakerOptions { localeFallback?: UsableLocale; } -const metadataKeys: ReadonlyArray = [ - 'title', - 'separator', -]; +const metadataKeys: ReadonlyArray = ['title']; export class Faker { locales: UsedLocales; diff --git a/src/locales/ar/index.ts b/src/locales/ar/index.ts index 7b81efd8db5..cd7e590b2f6 100644 --- a/src/locales/ar/index.ts +++ b/src/locales/ar/index.ts @@ -15,7 +15,6 @@ import vehicle from './vehicle'; const ar: LocaleDefinition = { title: 'Arabic', - separator: ' & ', cell_phone, color, commerce, diff --git a/src/locales/az/index.ts b/src/locales/az/index.ts index fe89852b943..043e35efeee 100644 --- a/src/locales/az/index.ts +++ b/src/locales/az/index.ts @@ -14,7 +14,6 @@ import phone_number from './phone_number'; const az: LocaleDefinition = { title: 'Azerbaijani', - separator: ' və ', color, commerce, company, diff --git a/src/locales/el/index.ts b/src/locales/el/index.ts index 4c235730818..5c3480abb1c 100644 --- a/src/locales/el/index.ts +++ b/src/locales/el/index.ts @@ -20,7 +20,6 @@ import team from './team'; const el: LocaleDefinition = { title: 'Greek', - separator: ' & ', app, business, cell_phone, diff --git a/src/locales/en/index.ts b/src/locales/en/index.ts index 3cd7a1b69ff..c55491cc641 100644 --- a/src/locales/en/index.ts +++ b/src/locales/en/index.ts @@ -28,7 +28,6 @@ import word from './word'; const en: LocaleDefinition = { title: 'English', - separator: ' & ', animal, app, business, diff --git a/src/locales/es_MX/index.ts b/src/locales/es_MX/index.ts index ef6ac63bd0d..dcaebecb70f 100644 --- a/src/locales/es_MX/index.ts +++ b/src/locales/es_MX/index.ts @@ -16,7 +16,6 @@ import team from './team'; const es_MX: LocaleDefinition = { title: 'Spanish (Mexico)', - separator: ' & ', cell_phone, color, commerce, diff --git a/src/locales/ge/index.ts b/src/locales/ge/index.ts index 2b7b332d625..dd187ba27fa 100644 --- a/src/locales/ge/index.ts +++ b/src/locales/ge/index.ts @@ -12,7 +12,6 @@ import phone_number from './phone_number'; const ge: LocaleDefinition = { title: 'Georgian', - separator: ' და ', cell_phone, company, internet, diff --git a/src/locales/he/index.ts b/src/locales/he/index.ts index 9720dce8e97..b54fc8946e8 100644 --- a/src/locales/he/index.ts +++ b/src/locales/he/index.ts @@ -15,7 +15,6 @@ import phone_number from './phone_number'; const he: LocaleDefinition = { title: 'Hebrew', - separator: 'ו ', cell_phone, color, commerce, diff --git a/src/locales/hy/index.ts b/src/locales/hy/index.ts index ae14d46d9f5..5dda2bdd5ea 100644 --- a/src/locales/hy/index.ts +++ b/src/locales/hy/index.ts @@ -13,7 +13,6 @@ import phone_number from './phone_number'; const hy: LocaleDefinition = { title: 'Armenian', - separator: ' և ', color, date, internet, diff --git a/src/locales/lv/index.ts b/src/locales/lv/index.ts index e38fa60ff11..1886bfe22a4 100644 --- a/src/locales/lv/index.ts +++ b/src/locales/lv/index.ts @@ -16,7 +16,6 @@ import phone_number from './phone_number'; const lv: LocaleDefinition = { title: 'Latvian', - separator: ' un ', cell_phone, color, commerce, diff --git a/src/locales/mk/index.ts b/src/locales/mk/index.ts index 6b1d245e587..11227239c4f 100644 --- a/src/locales/mk/index.ts +++ b/src/locales/mk/index.ts @@ -13,7 +13,6 @@ import phone_number from './phone_number'; const mk: LocaleDefinition = { title: 'Macedonian', - separator: ' и ', cell_phone, company, date, diff --git a/src/locales/ru/index.ts b/src/locales/ru/index.ts index 966430dbd56..651abae69d7 100644 --- a/src/locales/ru/index.ts +++ b/src/locales/ru/index.ts @@ -16,7 +16,6 @@ import phone_number from './phone_number'; const ru: LocaleDefinition = { title: 'Russian', - separator: ' и ', color, commerce, company, diff --git a/src/locales/ur/index.ts b/src/locales/ur/index.ts index 6b4cd3a3555..48128afd5be 100644 --- a/src/locales/ur/index.ts +++ b/src/locales/ur/index.ts @@ -20,7 +20,6 @@ import vehicle from './vehicle'; const ur: LocaleDefinition = { title: 'Urdu', - separator: ' اور ', animal, app, business, diff --git a/test/faker.spec.ts b/test/faker.spec.ts index 50579f60d6f..75d515f7519 100644 --- a/test/faker.spec.ts +++ b/test/faker.spec.ts @@ -76,20 +76,6 @@ describe('faker', () => { }); }); - describe('separator', () => { - it.each(Object.keys(faker.locales))('separator (%s)', (locale) => { - faker.locale = locale; - expect(faker.definitions.separator).toBeTypeOf('string'); - }); - - it('separator (with fallback)', () => { - // Use a language that doesn't have a separator specified - expect(faker.locales['en_US'].separator).toBeUndefined(); - // Check that the fallback works - expect(faker.definitions.separator).toBe(faker.locales['en'].separator); - }); - }); - it('locale definition accessability', () => { // Metadata expect(faker.definitions.title).toBeDefined();