Skip to content

fix(l10n): include the count as a placeholder in the catalog labels - #127

Merged
vitormattos merged 3 commits into
mainfrom
fix/issue-124-l10n-count-placeholder
Nov 14, 2026
Merged

vitormattos merged 3 commits into
mainfrom
fix/issue-124-l10n-count-placeholder

Conversation

@YvesCesar

@YvesCesar YvesCesar commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

Related issue: #124

The configured-fields counter and the select options counter were built by placing a <strong> with the number next to a separately translated label (fields configured, Options). The sentence order was therefore hardcoded in the template, so languages that put the number after the noun — RTL languages in particular — could not translate it correctly.

Changes

  • The count is now part of the translatable string: {count} field configured / {count} fields configured and {count} option / {count} options.
  • New splitCountLabel() helper (src/utils/countLabel.ts) resolves the translated string and splits it around the placeholder, so the template can still render the number inside a <strong> while the translator keeps full control of the word order.
  • If a translation drops the placeholder, the count is rendered before the label instead of disappearing.
  • Styles adjusted for the new inline layout, and the Playwright screenshot script updated to the new DOM structure.

@YvesCesar
YvesCesar marked this pull request as draft September 5, 2026 15:53
@YvesCesar

Copy link
Copy Markdown
Member Author

Pipeline failures will likely be resolved in #128

@YvesCesar
YvesCesar marked this pull request as ready for review September 8, 2026 22:38
vitormattos
vitormattos previously approved these changes Sep 9, 2026
Comment thread src/utils/countLabel.ts Resolved
@vitormattos

Copy link
Copy Markdown
Member

Will be necessary implement the #130 first

@YvesCesar

Copy link
Copy Markdown
Member Author

Hi @vitormattos

Will be necessary implement the #130 first

Done.

YvesCesar and others added 3 commits November 14, 2026 12:49
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: Vitor Mattos <vitor@php.rio>
@YvesCesar
YvesCesar force-pushed the fix/issue-124-l10n-count-placeholder branch from d783765 to d28a995 Compare November 14, 2026 16:49
@vitormattos

Copy link
Copy Markdown
Member

/backport to stable35

@vitormattos

Copy link
Copy Markdown
Member

/backport to stable34

@vitormattos

Copy link
Copy Markdown
Member

/backport to stable33

@vitormattos
vitormattos merged commit 1d1931d into main Nov 14, 2026
24 checks passed
@vitormattos
vitormattos deleted the fix/issue-124-l10n-count-placeholder branch November 14, 2026 20:14
@vitormattos

vitormattos commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Setup backport bot.

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