diff --git a/i18n/config/README.md b/i18n/config/README.md new file mode 100644 index 00000000..2716caab --- /dev/null +++ b/i18n/config/README.md @@ -0,0 +1,39 @@ +# Staged pipeline config + +**Nothing here is active.** `gt.config.json` sits here rather than at the repo root, where it would be live. + +| File | Moves to | When | +| --- | --- | --- | +| `gt.config.json` | repo root | If General Translation is chosen **and** `docs.json` has a `languages` array | + +Move it early and it fails immediately: it targets a `$.navigation.languages` path that does not exist yet. + +The CI workflow that consumes it lands separately (DF-831). + +## If Mintlify-native translations win + +**Delete this file.** Mintlify opens the translation PR itself — no config, no workflow, no third-party +secret. See [`../03-tooling-evaluation.md`](../03-tooling-evaluation.md). + +## About `gt.config.json` + +Adapted from [`mintlify/docs`](https://github.com/mintlify/docs)' own config — Mintlify localize their +documentation with this tool, on this stack. Differences from theirs: + +- **`reference/` and `changelogs.mdx` excluded.** Wave 2 and never, respectively + ([scope](../02-scope-and-preservation-spec.md#waves)). +- **No OpenAPI localization.** They localize `*.openapi.json` with a JSON preset; Mixpanel's specs are + `openapi/*.yaml`. Deferred with wave 2 — needs verification that the YAML bucket handles it. +- **`snippets/` excluded.** Checked: every exported string is a proper noun already on the do-not-translate + list, so there is nothing to localize. +- **`locales: ["en", "ko"]`** rather than their four. + +Retained deliberately — these are the settings that solve the hard problems: + +| Setting | Solves | +| --- | --- | +| `experimentalAddHeaderAnchorIds: "mintlify"` | The 710 fragment links | +| `experimentalLocalizeStaticUrls` + `docsUrlPattern` | 2,721 internal links → `/ko/...` | +| `jsonSchema.composite["$.navigation.languages"]` | All of DF-824, automatically | +| `generateRedirects` | Keeps the 881 existing redirects working per locale | +| `experimentalHideDefaultLocale` | English stays at the root, unmoved | diff --git a/i18n/config/gt.config.json b/i18n/config/gt.config.json new file mode 100644 index 00000000..7b6691d6 --- /dev/null +++ b/i18n/config/gt.config.json @@ -0,0 +1,54 @@ +{ + "$schema": "https://assets.gtx.dev/config-schema.json", + "_comment": "STAGED — not active. Move to the repo root only after the docs.json languages array exists (see i18n/nav/README.md) and GT is chosen over Mintlify-native translations (see i18n/03-tooling-evaluation.md). Adapted from mintlify/docs' own gt.config.json.", + + "defaultLocale": "en", + "locales": ["en", "ko"], + + "files": { + "mdx": { + "include": ["./docs/**/*.mdx", "./guides/**/*.mdx"], + "exclude": [ + "./[locales]/**/*.mdx", + "./reference/**/*.mdx", + "./changelogs.mdx", + "./snippets/**/*.mdx" + ], + "transform": { + "match": "^(.*)$", + "replace": "{locale}/$1" + } + }, + "json": { + "include": ["./docs.json"] + } + }, + + "options": { + "jsonSchema": { + "./docs.json": { + "composite": { + "$.navigation.languages": { + "type": "array", + "key": "$.language", + "include": ["$..group", "$..tab", "$..item", "$..anchor", "$..dropdown"], + "transform": { + "$..pages[*]": { "match": "^(.*)$", "replace": "{locale}/$1" }, + "$..root": { "match": "^(.*)$", "replace": "{locale}/$1" } + }, + "experimentalSort": "locales" + } + } + } + }, + + "docsUrlPattern": "/[locale]", + "generateRedirects": "./docs.json", + + "experimentalLocalizeStaticUrls": true, + "experimentalHideDefaultLocale": true, + "docsHideDefaultLocaleImport": true, + "experimentalAddHeaderAnchorIds": "mintlify", + "experimentalClearLocaleDirs": true + } +}