feat(theme): add initial i18n support#1210
Conversation
|
Visit the preview URL for this PR (updated for commit bff2fc7): https://docusaurus-openapi-36b86--pr1210-b3lsuhbz.web.app (expires Sat, 16 Aug 2025 17:56:45 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
* feat(theme): add initial i18n support * Add i18n wrappers across more theme components * localize remaining theme components
|
i18n strings are not extracted by write-translations The runtime side of this PR works: components call The problem is static extraction. Running docusaurus write-translations does not pick up any of these strings, so there's no generated template for translators to fill in. Root cause: every Docusaurus extracts code translations via Babel in Babel's The whole argument is skipped and a warning is logged — nothing lands in code.json. The same applies to the Fix: the id (and ideally description) must be string literals at the call site for extraction to work, e.g.: The Separately, worth noting for users: these are theme code translations, so overrides belong in i18n//code.json — not in i18n//docusaurus-plugin-content-docs-api/current.json (which only holds docs-plugin content translations like version.label). Putting theme.openapi.* keys in the latter has no effect. |
Summary
Covered components:
Addresses #1146 and #319
Testing
yarn lintyarn testhttps://chatgpt.com/codex/tasks/task_e_6865400bebe483238103ef34d718fea3