From 0bc6c2fbe65de9a9f706aa6f78f3b07940038461 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Sun, 29 Jan 2023 16:27:47 +0100 Subject: refactor(locale)!: remove unused separator entry (#1731) --- scripts/generateLocales.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/generateLocales.ts b/scripts/generateLocales.ts index 07cf47e7..ce7bce60 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}',` ); } -- cgit v1.2.3