Skip to content

fix(i18n): repair broken placeholders in translations - #2093

Merged
0xJacky merged 1 commit into
0xJacky:devfrom
ChandraChaan:fix/po-placeholders-upstream
Nov 7, 2026
Merged

0xJacky merged 1 commit into
0xJacky:devfrom
ChandraChaan:fix/po-placeholders-upstream

Conversation

@ChandraChaan

Copy link
Copy Markdown
Contributor

Several translated strings use a placeholder that the UI cannot fill in, so the user sees the raw text or the wrong value.

File Source string Problem
de_DE, es, tr_TR, vi_VN This is a test message sent at %{timestamp} ... %{Timestamp} / %{TimeStamp} (wrong case)
fr_FR same à% {horodat} (stray space, wrong name)
ja_JP same %{Timestamp} (full-width percent sign, wrong case)
ar %{count} down ٪{count} (Arabic percent sign)
es Delete stream: %{stream_name} %{site_name}
zh_CN Enable Remote Site Maintenance Error an unrelated sentence containing %{node} and %{site}; now 启用远程站点维护错误, matching the neighbouring "禁用远程站点维护错误"

This also adds internal/translation/placeholders_test.go. For every non-fuzzy entry of every app/src/language/*.po it checks that the translation only uses placeholders that the source string (or its plural) has, and that no placeholder is malformed (look-alike percent sign or a space before the brace).

Verified on my fork (Unit Tests workflow, go test -tags=unembed):

The fork's Build workflow stayed queued and never started on either branch, so I have not seen it run. Only .po files and one Go test change.

I edited the .po files directly. If translations should go through Weblate, the same nine edits can be made there and the test will keep guarding the catalogs.

Nine translated strings had a %{name} placeholder that the UI cannot fill
in: wrong case (%{Timestamp} for %{timestamp}), a wrong name
(%{site_name} for %{stream_name}), a look-alike percent sign (U+FF05,
U+066A), a stray space (% {horodat}), and an unrelated sentence in
zh_CN. Fix them and add a test that compares the placeholders of every
translation with its source string.
@0xJacky 0xJacky added the bug Something isn't working label Nov 7, 2026

@0xJacky 0xJacky left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking these down. The table in the description made this easy to review. We checked every catalog independently and found exactly the nine entries you fixed, with nothing left after your change. CI is green, including the new test. Editing the .po files directly is fine; Weblate will pick up the changes. Merging.

@0xJacky
0xJacky merged commit c7c5801 into 0xJacky:dev Nov 7, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants