Repository navigation
fix(l10n): Use positional placeholders in strings with multiple %s - #647
Open
rakekniven wants to merge 1 commit into
Open
rakekniven wants to merge 1 commit into
rakekniven wants to merge 1 commit into
Conversation
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>
This was referenced Dec 3, 2026
fix(l10n): Use positional placeholders in strings with multiple %s
nextcloud/preferred_providers#192
Open
Merged
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.
Summary
Translatable strings that contain more than one plain
%sfix the order of the inserted values: the first%salways 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
%swith numbered placeholders in the two affected email texts inlib/Services/Request.php:The user %s, identified by user id "%s", has requested an export of their personal data. Please take action accordingly.The user %1$s, identified by user id "%2$s", has requested an export of their personal data. Please take action accordingly.The user %s, identified by user id "%s", has requested to delete their account. Please take action accordingly.The user %1$s, identified by user id "%2$s", has requested to delete their account. Please take action accordingly.IL10N::t()formats withvsprintf(), which renders%1$s %2$sexactly 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.
Related: the same change for other apps in nextcloud/server#67609, nextcloud/calendar#9337, nextcloud/circles#3204, nextcloud/deck#8843, nextcloud/passman#896 and nextcloud/app_api#1237.
AI
The content of this PR was partly generated using AI.
🤖 Generated with Claude Code