Skip to content

Commit caab54d

Browse files
RiskeyLclaude
andauthored
Fix the language switching issue (#709)
* fix: remove href from language blocks to preserve page on language switch Mintlify's language switcher navigates to the explicit href when set, instead of doing smart path prefix replacement. Removing href lets the switcher stay on the current page when switching languages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Revert "fix: remove href from language blocks to preserve page on language switch" This reverts commit b74b1b8. * fix: restructure navigation from versions>languages to languages>versions Mintlify's language switcher only preserves the current page when languages are the top-level navigation partition. Previously, versions were the top level with languages nested inside, causing the switcher to redirect to the introduction page instead of the same page in the target language. Also removes explicit href from language blocks and fixes ja having default=true incorrectly in the 3.2.x version config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: align zh/ja API spec operationIds with en for language switching Mintlify generates page URL slugs from operationId. When operationIds differ between languages (e.g., en: sendChatMessage vs zh: sendBasicChatMessageCn), the language switcher can't find the equivalent page and falls back to the introduction page. This aligns all zh/ja operationIds to match en for endpoints that share the same HTTP method and path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: align OpenAPI tags across languages for consistent URL slugs Mintlify uses OpenAPI tags to generate URL category paths (e.g., tag "Chat" → /chat/). When zh uses "对话消息" and ja uses "チャットメッセージ", the generated URLs differ from en's, breaking language switching. This aligns all zh/ja OpenAPI spec tags to match en, ensuring identical URL structures across languages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add x-displayName to preserve translated tag names in sidebar Tags use English names for URL slug generation (consistent across languages) but x-displayName holds the translated names for display in the sidebar, so Chinese/Japanese users still see localized labels. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use x-mint href to align API reference URLs across languages Mintlify generates API page URLs from the tag name + summary, both of which are translated in zh/ja specs. This produces different URL slugs (e.g., en: /chat/send-chat-message vs zh: /对话消息/发送对话消息), making language switching impossible. Instead of changing the visible content (tags, summaries), this adds x-mint: { href: ... } to each endpoint in zh/ja specs, explicitly setting the URL path to match en. All translated content (tags, summaries, descriptions) is preserved as-is for readers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add language prefix to x-mint href to prevent cross-language conflicts Without the language prefix, zh/ja endpoints claimed the same absolute URL as en (e.g., /api-reference/chat/send-chat-message), causing ja content to appear on en pages. Now each language has its own prefixed href (e.g., /zh/api-reference/chat/send-chat-message), keeping content correctly scoped while enabling language switching. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * revert: remove all API spec changes (x-mint href, operationId, tag alignment) These changes are breaking and need careful coordination with the dev team before implementation. Only the navigation restructure (versions>languages → languages>versions) is kept for this PR. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * remove all enterprise versions --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5df20ab commit caab54d

1 file changed

Lines changed: 25 additions & 5390 deletions

File tree

0 commit comments

Comments
 (0)