diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/generate-locales.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index cba70edc..67b48553 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -375,7 +375,7 @@ removeIndexTs(locales); let localeIndexImports = ''; let localeIndexExportsIndividual = ''; let localeIndexExportsGrouped = ''; -let localesIndexExports = ''; +let localesIndexImports = ''; let localizationLocales = '| Locale | Name | Faker |\n| :--- | :--- | :--- |\n'; @@ -406,7 +406,7 @@ for (const locale of locales) { localeIndexImports += `import { faker as ${localizedFaker} } from './${locale}';\n`; localeIndexExportsIndividual += ` ${localizedFaker},\n`; localeIndexExportsGrouped += ` ${locale}: ${localizedFaker},\n`; - localesIndexExports += `export { default as ${locale} } from './${locale}';\n`; + localesIndexImports += `import { default as ${locale} } from './${locale}';\n`; localizationLocales += `| \`${locale}\` | ${localeTitle} | \`${localizedFaker}\` |\n`; // src/locale/<locale>.ts @@ -445,7 +445,11 @@ writeFileSync(pathLocaleIndex, localeIndexContent); let localesIndexContent = ` ${autoGeneratedCommentHeader} - ${localesIndexExports} + ${localesIndexImports} + + export { ${locales.join(',')} }; + + export const allLocales = { ${locales.join(',')} }; `; localesIndexContent = await formatTypescript(localesIndexContent); |
