Repository navigation
Copy page menu: translate it on translated pages, keep it on screen - #865
Merged
Merged
Conversation
Machine-translated pages run the English build's JS, so the menu reads the page language from the URL and uses its strings for the 11 languages of translate-docs (also human-translated builds in those languages). Labels get dir=auto for right-to-left pages, and the menu opens rightwards when there's no room left of its trigger. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In right-to-left pages the trigger sits at the left, next to the docs sidebar, which paints over the content column: open rightwards there. Position from the menu's measured width, clamped to the viewport. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On machine-translated pages, the "Copy page" button and its menu were still in English. Those pages run the English build's JS, so the language can't come from the build's
DOCS_LANGUAGE./docs/{lib}/[{version}/]{lang}/…, same rules ashfDocPaths.js). It uses strings for the 11translate-docslanguages (newcopyMenuStrings.ts) and falls back to English. This covers the button, "Copied", all menu items and the aria labels. Human-translated builds in those languages get it too.dir="auto", so in Arabic, "فتح في ChatGPT" reads in the right order.Tested end to end. I built two Hub pages with this kit and translated them to ja and ar from the translation cache, then served them from a local moon-landing:
npm run checkshows no new warnings.The Hub docs need a rebuild with this kit, which means bumping hub-docs' doc-builder pin. The translation job then picks up the new asset hashes, with only cache hits.
🤖 Generated with Claude Code