You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(l10n): Use positional placeholders in strings with multiple %s - #1237
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 two affected strings in lib/SetupChecks/HarpVersionCheck.php:
Before
After
HaRP version for daemon "%s" is "%s", which is too old. The minimum required version is "%s". Please update the daemon to the latest version.
HaRP version for daemon "%1$s" is "%2$s", which is too old. The minimum required version is "%3$s". Please update the daemon to the latest version.
Failed to check HaRP version for daemon "%s": %s
Failed to check HaRP version for daemon "%1$s": %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:tests/php/SetupChecks/HarpVersionCheckTest.php mocks t() with vsprintf() and checks the formatted message, which stays the same. I did not run the tests locally.
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>
The too-old-version and check-failure messages now use positional translation placeholders. Their content, arguments, version-check behavior, and exception logging remain unchanged.
Merge Risk: Low · up to ade1b
English output is unchanged. Non-English users may see these two HaRP warnings in English until the updated translations are shipped, as the PR already notes.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: numbered positional placeholders replace plain %s in strings with multiple placeholders, so translators can reorder values. The changeset edits two strings in HarpVers…
Description check
The description explains the problem (plain %s forces the first argument into the first slot, which blocks word reordering in translations), lists the before and after strings for both affected messag…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: numbered positional placeholders replace plain %s in strings with multiple placeholders, so translators can reorder values. The changeset edits two strings in HarpVersionCheck.php to use %1$s, %2$s, %3$s, which matches the title. The title uses the fix(l10n) prefix, which is conventional and clear.
Full details: Description check
Explanation
The description explains the problem (plain %s forces the first argument into the first slot, which blocks word reordering in translations), lists the before and after strings for both affected messages, and states that English output is unchanged. It also covers the Transifex impact and the test setup, so it relates directly to the changeset.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 6cea883e-535d-4d36-8f9e-6a686753d89b
Commits
Reviewing files that changed from the base of the PR and between 729cabc and ade1bf6.
Files selected for processing: 1
lib/SetupChecks/HarpVersionCheck.php
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
if (!$this->fulfillsMinimumVersionRequirement($versionString)) {
$issues[] = $this->l10n->t('HaRP version for daemon "%s" is "%s", which is too old. The minimum required version is "%s". Please update the daemon to the latest version.', [$daemonConfig->getName(), $versionString, Application::MINIMUM_HARP_VERSION]);
$issues[] = $this->l10n->t('HaRP version for daemon "%1$s" is "%2$s", which is too old. The minimum required version is "%3$s". Please update the daemon to the latest version.', [$daemonConfig->getName(), $versionString, Application::MINIMUM_HARP_VERSION]);
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Preserve the existing translations for both warnings.
The new message IDs do not match the shipped catalog entries. Non-English users will therefore see these warnings in English until updated translations are shipped. Coordinate the catalog updates with this change, or migrate the existing translations to the numbered placeholders.
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
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 strings inlib/SetupChecks/HarpVersionCheck.php:HaRP version for daemon "%s" is "%s", which is too old. The minimum required version is "%s". Please update the daemon to the latest version.HaRP version for daemon "%1$s" is "%2$s", which is too old. The minimum required version is "%3$s". Please update the daemon to the latest version.Failed to check HaRP version for daemon "%s": %sFailed to check HaRP version for daemon "%1$s": %2$sIL10N::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:
tests/php/SetupChecks/HarpVersionCheckTest.phpmockst()withvsprintf()and checks the formatted message, which stays the same. I did not run the tests locally.Related: the same change for other apps in nextcloud/server#67609, nextcloud/calendar#9337, nextcloud/circles#3204, nextcloud/deck#8843 and nextcloud/passman#896.
AI
The content of this PR was partly generated using AI.
🤖 Generated with Claude Code