diff options
| author | Shinigami <[email protected]> | 2022-09-11 21:41:19 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-09-11 09:41:19 -0400 |
| commit | 907558bd64230bde070a37870667c368ecd56881 (patch) | |
| tree | b206fd5cd5b413d29c14f8061a730ca380a23734 /scripts | |
| parent | 8db9d6e8743d080431093b643b0a238d73c422e8 (diff) | |
| download | faker-907558bd64230bde070a37870667c368ecd56881.tar.xz faker-907558bd64230bde070a37870667c368ecd56881.zip | |
docs: localization (#1364)
Co-authored-by: ST-DDT <[email protected]>
Co-authored-by: Leyla Jähnig [email protected]
Co-authored-by: Eric Cheng <[email protected]>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/apidoc.ts | 1 | ||||
| -rw-r--r-- | scripts/generateLocales.ts | 12 |
2 files changed, 6 insertions, 7 deletions
diff --git a/scripts/apidoc.ts b/scripts/apidoc.ts index 165034bc..0ad01248 100644 --- a/scripts/apidoc.ts +++ b/scripts/apidoc.ts @@ -34,7 +34,6 @@ async function build(): Promise<void> { patchProject(project); const modulesPages: PageIndex = []; - modulesPages.push({ text: 'Localization', link: '/api/localization.html' }); modulesPages.push(...processModuleMethods(project)); modulesPages.push(...processDirectMethods(project)); writeApiPagesIndex(modulesPages); diff --git a/scripts/generateLocales.ts b/scripts/generateLocales.ts index 1d41948f..dea43bcd 100644 --- a/scripts/generateLocales.ts +++ b/scripts/generateLocales.ts @@ -4,7 +4,7 @@ * - `src/locale/<locale>.ts` * - `src/locales/<locale>/index.ts` * - `src/locales/<locale>/<module...>/index.ts` - * - `src/docs/api/localization.md` + * - `src/docs/guide/localization.md` * * If you wish to edit all/specific locale data files you can do so using the * `updateLocaleFileHook()` method. @@ -25,10 +25,10 @@ const pathRoot = resolve(__dirname, '..'); const pathLocale = resolve(pathRoot, 'src', 'locale'); const pathLocales = resolve(pathRoot, 'src', 'locales'); const pathLocalesIndex = resolve(pathLocales, 'index.ts'); -const pathDocsApiLocalization = resolve( +const pathDocsGuideLocalization = resolve( pathRoot, 'docs', - 'api', + 'guide', 'localization.md' ); @@ -323,13 +323,13 @@ let indexContent = ` indexContent = format(indexContent, prettierTsOptions); writeFileSync(pathLocalesIndex, indexContent); -// docs/api/localization.md +// docs/guide/localization.md localizationLocales = format(localizationLocales, prettierMdOptions); -let localizationContent = readFileSync(pathDocsApiLocalization, 'utf-8'); +let localizationContent = readFileSync(pathDocsGuideLocalization, 'utf-8'); localizationContent = localizationContent.replace( /(^<!-- LOCALES-AUTO-GENERATED-START -->$).*(^<!-- LOCALES-AUTO-GENERATED-END -->$)/gms, `$1\n\n<!-- Run '${scriptCommand}' to update. -->\n\n${localizationLocales}\n$2` ); -writeFileSync(pathDocsApiLocalization, localizationContent); +writeFileSync(pathDocsGuideLocalization, localizationContent); |
