Skip to content

Fix the language switching issue#709

Merged
RiskeyL merged 10 commits intomainfrom
fix/language-switching
Mar 16, 2026
Merged

Fix the language switching issue#709
RiskeyL merged 10 commits intomainfrom
fix/language-switching

Conversation

@RiskeyL
Copy link
Copy Markdown
Contributor

@RiskeyL RiskeyL commented Mar 16, 2026

No description provided.

RiskeyL and others added 10 commits March 9, 2026 16:41
…itch

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>
…ions

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>
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>
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>
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>
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>
…flicts

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>
…ignment)

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>
Copilot AI review requested due to automatic review settings March 16, 2026 09:08
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@dosubot dosubot bot added the bug Something isn't working label Mar 16, 2026
@RiskeyL RiskeyL merged commit caab54d into main Mar 16, 2026
1 of 2 checks passed
@RiskeyL RiskeyL deleted the fix/language-switching branch March 19, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants