Skip to content

fix(l10n): Use positional placeholders in strings with multiple %s - #6429

Merged
elzody merged 1 commit into
nextcloud:mainfrom
rakekniven:fix/l10n-positional-placeholders
Dec 3, 2026
Merged

elzody merged 1 commit into
nextcloud:mainfrom
rakekniven:fix/l10n-positional-placeholders

Conversation

@rakekniven

Copy link
Copy Markdown
Member

Summary

Translatable strings that contain more than one plain %s fix the order of the inserted values: the first %s always gets the first value. Languages with a different word order cannot move them, so translators either have to bend the sentence or end up with values in the wrong place.

This PR replaces the plain %s with numbered placeholders in the affected string:

File Before After
lib/SetupCheck/CollaboraUpdate.php Collabora server version is out of date. Currently using %s, new version is available: %s Collabora server version is out of date. Currently using %1$s, new version is available: %2$s

IL10N::t() formats with vsprintf(), which renders %1$s %2$s exactly like %s %s, so the English output does not change. Only the placeholders change; the wording stays the same.

Effect on translations: the source strings change, so Transifex treats them as new. Translation memory should offer the old translations as close matches, but translators have to accept them and add the numbered placeholders.

Tests: no test refers to these strings. I did not run the tests locally.

TODO

  • None

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

This PR was partly generated using AI.

🤖 Generated with Claude Code

Strings with more than one plain %s force translators to keep the
English order of the values. Numbered placeholders (%1$s, %2$s) let
them reorder the values where their language needs it. IL10N::t()
formats with vsprintf(), which renders both forms identically, so the
output does not change.

Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rakekniven
rakekniven enabled auto-merge December 3, 2026 19:57
@elzody
elzody disabled auto-merge December 3, 2026 21:01
@elzody
elzody merged commit 7b18ff0 into nextcloud:main Dec 3, 2026
58 of 62 checks passed
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.

3 participants