Skip to content

UI: Group digits of counters in translated strings - #74296

Merged
choo121600 merged 4 commits into
apache:mainfrom
shahar1:ui-locale-number-placeholders
Oct 10, 2026
Merged

choo121600 merged 4 commits into
apache:mainfrom
shahar1:ui-locale-number-placeholders

Conversation

@shahar1

@shahar1 shahar1 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

related: #73713

Followup to the above, this PR applies the digit grouping in all existing locales (changes in 171 files, most of them are technical as changing {{count}} to {{counter,number}}.

AI Summary Follow-up to #73713, which grouped digits of numbers the UI renders directly. Counters interpolated into translated strings (Dag, run and task counts, import errors, pool slots, deadlines, log search matches, ...) still render as raw integers, so `12345` shows instead of `12,345` (en), `12.345` (de) or `12 345` (fr).

This routes every counter placeholder through i18next's built-in number formatter ({{count}} → {{count, number}}) in all locales, so each language gets its own grouping without custom separator logic. Plural selection is unchanged: i18next still picks the plural form from the raw count.

  • src/i18n/locales.test.ts fails if any locale adds a counter placeholder (count, current, total, missedCount, upcomingCount) without the formatter, and checks grouping for plural and non-plural counters in en and de.
  • breeze ui check-translation-completeness keeps treating {{count, number}} as plural-driving.
  • The airflow-translations skill tells translators to keep the , number suffix.

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5.5)

Generated-by: Claude Code (Opus 5.5) following the guidelines

@shahar1 shahar1 added this to the Airflow 3.4.0 milestone Oct 5, 2026
@shahar1
shahar1 force-pushed the ui-locale-number-placeholders branch 4 times, most recently from 5c3bed2 to 3c74d91 Compare October 6, 2026 03:08
@potiuk potiuk removed the backport-to-v3-4-test Backport to v3-4-test label Oct 6, 2026

@bbovenzi bbovenzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just rebase

@shahar1
shahar1 force-pushed the ui-locale-number-placeholders branch 4 times, most recently from f0f56da to fdf3882 Compare October 7, 2026 13:03

@choo121600 choo121600 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good
But it seems like the CI is failing. Could you take a look?

@shahar1
shahar1 force-pushed the ui-locale-number-placeholders branch 3 times, most recently from 537af13 to 0e27679 Compare October 10, 2026 11:54
Counters interpolated into translations (Dag, run and task counts, import
errors, pool slots, log search matches) rendered as raw integers, so large
values were hard to read and ignored the conventions of the selected UI
language (12,345 in English, 12.345 in German, 12 345 in French).

Routing them through i18next's built-in number formatter picks up each
locale's grouping without custom separator logic. A locale test guards
against new counter placeholders skipping the formatter, the translation
completeness check keeps treating formatted counts as plural-driving, and
the translation skill tells translators to keep the formatter suffix.
i18next blanks a counter passed as undefined only when the placeholder is
unformatted. With the number formatter it looks the value up under the whole
"count, number" expression, finds nothing and prints the raw placeholder, so
a not-yet-loaded total would show "{{total, number}}" to the user instead of
an empty gap.
Strings added to the zh-TW locale on main after the previous rebase used a
bare {{count}} placeholder, which the locale counter test rejects.
Strings added to the pl, el and ca locales on main used a bare {{count}}
placeholder, which the locale counter test rejects.

Claude-Session: https://claude.ai/code/session_01UbFJXAjB2dTsFiiMpc9HCM
@shahar1
shahar1 force-pushed the ui-locale-number-placeholders branch from 0e27679 to bc8689f Compare October 10, 2026 11:55

@choo121600 choo121600 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE

@choo121600
choo121600 merged commit 1a6ea88 into apache:main Oct 10, 2026
159 checks passed
@shahar1
shahar1 deleted the ui-locale-number-placeholders branch October 10, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants