Repository navigation
Exports: draw annotation text in every script, and translate everything into every supported language - #288
Merged
Merged
Conversation
Text boxes, tooltips and GIF title cards are burned into screenshots by the software rasterizer, whose Lato atlas only covers Latin; Chinese and other scripts came out as "?" in PDF, Word and every other export. Characters the atlas lacks are now drawn from the outlines of an installed font (the same font lists the PDF exporter uses), including CFF fonts such as Noto Sans CJK on Linux. Wrapping breaks between CJK characters.
core/export-text.js gives exporters the interface-language translator. tc(context, text) tells apart English text used in two senses, and the translation check now scans exporters/, core/renderast.js and core/pages-site.js and reads \n in messages.
Exports used English for everything StepForge adds, whatever language was chosen: "Last verified", "Contents", page numbers, alt text, callout names, step counts, the HTML checklist and copy buttons, the Confluence import instructions and the GitHub Pages front page. The export worker now gets the interface language (Settings > General > Language) with every job, the render AST carries it, and each exporter writes its labels through core/export-text.js. English output stays the same apart from "1 step" on a one-step PDF cover (was "1 steps") and a correctly sized underline in HOW-TO-IMPORT.txt. GitHub alert names stay English, since GitHub only reads those.
Errors and statuses from the sign-in, sync, publishing, AI, update and capture code were English in every language: Confluence, Wiki.js, GitHub, Google Drive, OneDrive, Dropbox and WebDAV messages, cloud sync status, brand profile and library errors, find-and-replace field names, the recording tray menu and the region-selection hint. core/ui-text.js holds the main process's translator; app/main.js sets its language with the interface's, and the translation check now scans all of app/, core/ and exporters/.
…lish npm run translations -- --same lists catalog entries that read the same as the English, for review (most are right: Description, Logo, OK).
Adds the main-process messages (sign-in, sync, publishing, AI, updates, capture, brand profiles, library) and the arrow keys shortcut, so npm run translations reports nothing missing.
Adds the main-process messages (sign-in, sync, publishing, AI, updates, capture, brand profiles, library) and the arrow keys shortcut, so npm run translations reports nothing missing.
Adds the main-process messages (sign-in, sync, publishing, AI, updates, capture, brand profiles, library) and the arrow keys shortcut, so npm run translations reports nothing missing.
Adds the main-process messages (sign-in, sync, publishing, AI, updates, capture, brand profiles, library) and the arrow keys shortcut, so npm run translations reports nothing missing.
Adds the main-process messages (sign-in, sync, publishing, AI, updates, capture, brand profiles, library) and the arrow keys shortcut, so npm run translations reports nothing missing.
They were translated when the module loaded, before the interface language is known.
Owner
Author
|
@codex review. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65c3373f0c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The cloud connection test decided pass or fail by looking for "failed"
in each check's text, and the Settings panel looked for /fail/i. With a
translated interface a failed cleanup showed a green check and "Connection
test passed." Each check is now { text, ok }. The sign-in, storage-access
and "Failed:" lines, which were still English, are translated too.
This was referenced Nov 9, 2026
…icode # Conflicts: # exporters/docx.js # exporters/html.js # exporters/pdf.js
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.
Issue
Part of #286 (point 2: export text stays English), plus @Weiking2019's report in discussion #188 (Chinese annotation text missing from PDF/Word exports).
Summary
Two problems, fixed together:
?in exports. In every format, text boxes and tooltips are burned into the screenshot by StepForge's own rasterizer. That rasterizer only had a Lato atlas of about 200 Latin characters. The editor looked fine because it draws with the system font. Now any character the atlas lacks is drawn from an installed font's outlines, the way a browser falls back to another font.Changes
Text in any script in exported images
core/text-raster.jsfills characters missing from the atlas using installed fonts, from the same font lists the PDF exporter uses (core/pdf-fonts.js). Glyphs sit on the Lato baseline at the same em size.core/ttf.jsreads glyph outlines, both simple and composite.core/cff.jsreads CFF charstrings, so Noto Sans CJK, the usual Linux CJK font, works. CFF fonts are still never embedded in PDFs.tests/unit/font-fixtures.js.Translations
app/main.jssends the interface language with every export, preview, clipboard copy, publish and quality-check job. It travels throughexport-runner→export-worker→buildRenderAst({ language })intoast.language.core/export-text.js.tc(context, text)incore/i18n.jscovers English words that need two translations ("Contents" as a TOC heading vs. the Export dialog option).<html lang>core/ui-text.jstranslates main-process messages (329 new strings): Confluence, Wiki.js, GitHub, Google Drive, OneDrive, Dropbox and WebDAV sign-in and errors; cloud sync status; brand and library errors; AI errors; update messages; the recording tray menu; the region-selection hint; capture errors.scripts/check-translations.jsnow scans all ofapp/,core/andexporters/, understandstc()and\n, and has a--sameoption that lists translations identical to the English.<span class="credit">, so GitHub Pages still finds it in any languageArea
Testing
bash tests/run_test.shpassesTested manually (describe below)
npm test: 1518 pass, 0 fail. New tests:annotation-text-unicode.test.js: TrueType and CFF outlines, glyph size and position, CJK wrapping, font preference, and a real-font test that runs when the machine has a Chinese font (Windows CI does).export-language.test.js: fr, zh-CN, ja, ru and es exports checked in PDF, DOCX, HTML, Markdown, Wiki.js, clipboard, PPTX, JSON and Confluence.npm run translations: fr, es, ru, zh-CN and ja are each at 2258 of 2258.WSL/Linux, end to end: a guide with a Chinese text box and tooltip, exported to Word and PDF through the real exporters.
C:\Windows\Fonts(the reporter's setup), Chinese draws correctly.With the language set to zh-CN, the Word export reads 上次验证:2026-11-09 / 下次审阅 / 1 个步骤 · 生成于 …, with no English left.
Still needs a manual check:
Screenshots or recordings
Word export of a step with a Chinese text box and tooltip, Windows fonts.
Before (main):
After:
Rollout notes
None. No settings or data changes. Exports made through the app now follow the interface language. Headless renders with no language stay English.
Known limits:
Checklist
t(), andnpm run translationslists nothing missing