Skip to content

fix(i18n): use a real newline in comment dialog tooltip string - #70

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/i18n-literal-backslash-n
Jun 11, 2026
Merged

fix(i18n): use a real newline in comment dialog tooltip string#70
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/i18n-literal-backslash-n

Conversation

@ngosang

@ngosang ngosang commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

The comment-dialog tooltip in src/muuli_wdr.cpp:705 contained double-escaped backslashes (\\n\\n), so the string holds literal backslash-n characters and the UI shows \n\n as plain text instead of a line break.

It was also the only msgid in the whole catalog with a literal backslash-n, and it is the root cause of the line-rewrapping churn in Weblate PRs (e.g. #66): Weblate's PO serializer (translate-toolkit quoteforpo) breaks lines after any \n escape sequence — including the one inside a literal backslash-n — even with the "wrap lines only at newlines" add-on setting, while gettext --no-wrap keeps it on one line. So every Weblate sync rewrapped this entry in every translated language, and the next repo-side update-po.sh run unwrapped it again (ping-pong).

Changes

  • src/muuli_wdr.cpp: \\n\\n\n (a real line break in the tooltip).
  • All po/*.po + po/amule.pot: migrated the affected msgid/msgstr in-place (this entry is the only occurrence of a literal backslash-n) so no translation goes fuzzy, then regenerated with scripts/update-po.sh.

Verification

  • msgfmt -c passes on all 37 catalogs.
  • Round-tripping the new files through translate-toolkit at width 65535 (what Hosted Weblate does) is now byte-identical to the gettext --no-wrap output, including a forced re-quote of the affected unit — Weblate will no longer rewrap it.
  • Rendering verified with a minimal wxWidgets 3.2.10 (wxGTK) program under Xvfb: the tooltip shows two lines separated by a real line break. wxMSW also supports multiline tooltips natively (TTM_SETMAXTIPWIDTH), and aMule already ships another \n tooltip since 3.0.0 (src/muuli_wdr.cpp:1567).
  • The diff contains only this entry plus the volatile POT-Creation-Date header.

Note: this touches the same lines as the pending Weblate PR #66, so merge order matters — easiest is to merge #66 first, lock the Weblate components, rebase this branch (the conflict resolution is trivial), merge, then unlock.

The tooltip in src/muuli_wdr.cpp:705 contained double-escaped
backslashes (\\n\\n), so the string holds literal backslash-n
characters and the UI shows "\n\n" as text instead of a line break.
It was also the only msgid in the catalog with a literal backslash-n,
which broke the gettext/Weblate round-trip: Weblate's serializer
(translate-toolkit) wraps PO lines after any \n escape sequence --
including the one inside a literal backslash-n -- even in "wrap only
at newlines" mode, while gettext --no-wrap keeps it on one line.
Every Weblate PR rewrapped this entry in all translated languages as
a result.

Replace it with a real newline, migrate msgid/msgstr in-place in all
catalogs (no translation goes fuzzy) and regenerate with
scripts/update-po.sh. Rendering verified with wxGTK 3.2.10.
@ngosang
ngosang force-pushed the fix/i18n-literal-backslash-n branch from 959e4c3 to 4a4d40a Compare June 11, 2026 05:31
@ngosang ngosang changed the title fix(i18n): use real newlines in comment dialog tooltip string fix(i18n): use a real newline in comment dialog tooltip string Jun 11, 2026
@ngosang
ngosang merged commit a8e404d into amule-org:master Jun 11, 2026
8 checks passed
@ngosang
ngosang deleted the fix/i18n-literal-backslash-n branch June 11, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant