Repository navigation
feat(studio): open Help links in the browser's language - #67
Merged
Merged
Conversation
The documentation site is now in French, German and Spanish under /fr/, /de/ and /es/, with every English page at the same path and the same section anchors. Studio in a browser (npx markdown-pdf-export studio, and Zed and Cursor, which open it there) now points its Help links to that language when the browser's preferred language is one of them, English otherwise. Studio's own text stays English. An editor that shows Studio in its own panel picks the language itself (the VS Code extension does), so Studio leaves its links alone there. Tests keep Studio's language list in step with the site's, check each Help link and its section exist in every language, and check the script sends every link it writes through the language step.
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.
Summary
Follow-up to #66 (docs in French, German and Spanish). Studio in a browser (
npx markdown-pdf-export studio, and Zed and Cursor, which open it there) now points its Help links to the documentation in the browser's preferred language when the site has it, English otherwise. Studio's own text stays English.studio/model.mjs:DOCS_LANGUAGES,docsLanguageOf(tag)(fr,de-CH,es-419… → its folder) andlocalDocsUrl(url, language), which keeps#sections, links already in a language, shared files (/schema/,/img/,/samples/,/logo.png) and other sites unchanged. Same rule as the VS Code extension (Open the documentation in VS Code's display language vscode-markdown-pdf-export#39).studio/app.mjs: rewrites the page's links at start and sends the one link it builds later (hand-written header/footer notice) through the same step. When an editor embeds Studio (window.studioHost), Studio leaves its links alone: the editor picks the language (VS Code already does).filesand the smoke test are unchanged.Tests
studio-model.test.mjs: language tags and URL edge cases.studio-links.test.mjs: Studio's language list matches the site's (docs/.vitepress/theme/i18n); every Help link exists in each language with its pinned section anchor; the script sends every docs link it writes throughdocs()and keeps the editor-panel guard (checked to fail when the wrapper is removed).Test plan
npm test(618 pass),npm run lint,build-studio-strings --checkfr-FR,de-CH,es-419get/fr/,/de/,/es/links with sections;en-US,pt-BRstay English; no page errors