Repository navigation
fix(i18n): repair broken placeholders in translations - #2093
Merged
Merged
Conversation
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
approved these changes
Nov 7, 2026
0xJacky
left a comment
Owner
There was a problem hiding this comment.
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.
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.
Several translated strings use a placeholder that the UI cannot fill in, so the user sees the raw text or the wrong value.
This is a test message sent at %{timestamp} ...%{Timestamp}/%{TimeStamp}(wrong case)à% {horodat}(stray space, wrong name)%{Timestamp}(full-width percent sign, wrong case)%{count} down٪{count}(Arabic percent sign)Delete stream: %{stream_name}%{site_name}Enable Remote Site Maintenance Error%{node}and%{site}; now启用远程站点维护错误, matching the neighbouring "禁用远程站点维护错误"This also adds
internal/translation/placeholders_test.go. For every non-fuzzy entry of everyapp/src/language/*.poit 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):ok github.com/0xJacky/Nginx-UI/internal/translation): https://github.com/ChandraChaan/nginx-ui/actions/runs/42269294892The fork's
Buildworkflow 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.