Skip to content

fix(viewer): make the editor's messages translatable - #446

Merged
AndyScherzinger merged 2 commits into
mainfrom
fix/viewer-translatable-strings
Oct 26, 2026
Merged

AndyScherzinger merged 2 commits into
mainfrom
fix/viewer-translatable-strings

Conversation

@AndyScherzinger

@AndyScherzinger AndyScherzinger commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

On a German interface, the Save button turns into the English "Saving…" while saving.

src/viewer.js wrapped t() with the app id built in, so its calls looked like t('Saving…'). The translation extraction only picks up strings that are the second argument of t('<app>', '<text>'), so none of these strings ever reached Transifex: running xgettext --keyword=t:2 on the old file extracts nothing, on the new one all six.

Affected strings:

  • "Saving…" on the Save button
  • the confirmation when closing with unsaved changes
  • "Main Topic" for the root node of a new map
  • the warning about an invalid mind map file
  • the alert when a file cannot be loaded

Changes:

  • Pass the app id at each call.
  • Pass the load error as a {error} parameter instead of appending it. This also adds the missing space ("Load file fail!Unsupported file type…").
  • Reword the close confirmation ("The file has unsaved changes. Save them before closing?") and the load error ("Could not load the file: {error}"). Neither had translations yet.

The XMind import had a related gap: a file without content.json or content.xml failed with the untranslated "Content document missing", which the load alert then showed. It now uses "This file is not a valid XMind mind map.", matching the FreeMind import, with a test.

The translations themselves arrive through Transifex once the strings are picked up.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

The editor wrapped t() with the app id built in, so its calls had no
second argument and the translation extraction never picked up their
strings. "Saving…", the close confirmation, "Main Topic" and the load
errors therefore stayed English in every language.

Pass the app id at each call, and pass the load error as a parameter
instead of appending it, which also adds the missing space. Reword
the close confirmation and the load error, which had no translations
yet.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger AndyScherzinger added this to the v0.2.0 milestone Oct 26, 2026
@AndyScherzinger AndyScherzinger added bug Something isn't working AI assisted This PR contains AI-assisted commits labels Oct 26, 2026
@AndyScherzinger

Copy link
Copy Markdown
Member Author

/backport to stable-0.1

An XMind file without content.json or content.xml failed with the
English "Content document missing", which the load alert showed in
every language. Use a translated message that matches the FreeMind
import's.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger
AndyScherzinger merged commit 2c21f2f into main Oct 26, 2026
8 checks passed
@AndyScherzinger
AndyScherzinger deleted the fix/viewer-translatable-strings branch October 26, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant