Skip to content

Use a parameterized translation for CPU thread count#1032

Merged
kesselb merged 1 commit into
masterfrom
copilot/nextcloud-1022-i18n-include-parameters
Jul 8, 2026
Merged

Use a parameterized translation for CPU thread count#1032
kesselb merged 1 commit into
masterfrom
copilot/nextcloud-1022-i18n-include-parameters

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The CPU row in the admin settings rendered the thread count by concatenating a translated label with a raw numeric value. That prevents translators from reordering the phrase correctly for RTL and other locale-specific sentence structures.

  • i18n

    • Replaced the split rendering of CPU name, thread count, and threads label with a single translatable string using positional parameters
    • Lets translators control full phrase order instead of being locked to English word placement
  • Localization assets

    • Left the generated l10n/ files unchanged; the source string change is limited to the template and can be picked up by the normal translation pipeline
<?php p($l->t('%1$s (%2$d threads)', [$cpu->getName(), $cpu->getThreads()])) ?>

Copilot AI changed the title [WIP] Add parameters like thread count as variable for i18n fix(i18n): use parameterized string for CPU name and thread count Jun 22, 2026
Copilot AI requested a review from kesselb June 22, 2026 10:23
Copilot AI changed the title fix(i18n): use parameterized string for CPU name and thread count Use a parameterized translation for CPU thread count Jun 23, 2026
…able string

The CPU row in settings-admin.php previously used a standalone translated
"threads" word with the count concatenated outside the string, which
doesn't work properly for RTL languages or languages with different word
order.

Now uses a single translatable string '%1$s (%2$d threads)' with the CPU
name as %1$s and thread count as %2$d, allowing translators to reorder
components as needed.

Assisted-by: GitHub Copilot (claude-sonnet-4.6)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb kesselb force-pushed the copilot/nextcloud-1022-i18n-include-parameters branch from e03683b to 5cba1a7 Compare July 8, 2026 17:16
@kesselb kesselb marked this pull request as ready for review July 8, 2026 17:16
@kesselb kesselb requested a review from benjaminfrueh as a code owner July 8, 2026 17:16
@kesselb kesselb enabled auto-merge July 8, 2026 17:17
@kesselb

kesselb commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable34

@kesselb kesselb disabled auto-merge July 8, 2026 17:43
@kesselb kesselb merged commit 2eb1d72 into master Jul 8, 2026
42 checks passed
@kesselb kesselb deleted the copilot/nextcloud-1022-i18n-include-parameters branch July 8, 2026 17:43
@kesselb

kesselb commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable33

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.

2 participants