Skip to content

UI: Render Arabic durations with the correct dual/plural form - #72604

Merged
bbovenzi merged 1 commit into
apache:mainfrom
baha-bouali:fix-arabic-plural-durations
Oct 21, 2026
Merged

bbovenzi merged 1 commit into
apache:mainfrom
baha-bouali:fix-arabic-plural-durations

Conversation

@baha-bouali

Copy link
Copy Markdown
Contributor

Arabic inflects a counted noun four ways, but dayjs's ar locale stores a
single template per unit, so every count above one took the 3-10 form: a
two-hour deadline read "2 ساعات" where the dual is required, and an eleven-day
one read "11 أيام" instead of "11 يومًا".

The dual must also agree in case with whatever governs it, and it is the only
form that spells its case out rather than carrying it in an unwritten vowel.
Every humanized duration in this UI sits under a preposition -- خلال in the
deadline rule, and dayjs's own منذ / بعد around every relative time -- so the
oblique is the form these positions require.

Locales with comparable plural systems -- Hebrew, Russian, Polish -- already
pass a function instead of a template; Arabic was simply never migrated.
PR body

Arabic durations in the UI were both mis-pluralised and mis-inflected.

dayjs's ar locale stores one template per unit ("%d ساعات"), so every
count above one rendered the 3–10 form: a two-hour deadline read "2 ساعات",
an eleven-day one "11 أيام". Arabic has four plural categories, and the
dual and 11–99 forms are different words.

The dual also has to agree in case with what governs it — and it is the
only form that spells its case out. Every humanized duration here sits
under a preposition (خلال in the deadline rule, and dayjs's own منذ /
بعد around every relative time), so the oblique ساعتين is required,
not the citation form ساعتان.

Hebrew, Russian and Polish already pass a function instead of a template;
Arabic was never migrated. This applies the same treatment locally.

Before (DUAL)

image

After (DUAL , with accusative form)

image

Before (Plural - some)

image

After (Plural - some)

image

After (Singular) : correct as before

image

Counts of 3 and above are checked against Intl.DurationFormat, which
reads the same CLDR data, across every count in each unit's humanize
window. The dual is pinned explicitly, since Intl formats a standalone
duration and so returns the nominative.


Was generative AI tooling used to co-author this PR?
  • Yes : Claude Code, every line reviewed by the submitter.

Arabic inflects a counted noun four ways, but dayjs's `ar` locale stores a
single template per unit, so every count above one took the 3-10 form: a
two-hour deadline read "2 ساعات" where the dual "ساعتان" is required, and an
eleven-day one read "11 أيام" instead of "11 يومًا".

Locales with comparable plural systems -- Hebrew, Russian, Polish -- already
pass a function instead of a template and render correctly at every count;
Arabic was simply never migrated. This applies the same treatment locally
until the fix can be made upstream.

Two assertions from the previous change pinned the uninflected output and are
updated here.
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Sep 6, 2026
@baha-bouali

Copy link
Copy Markdown
Contributor Author

cc @hussein-awala

@bbovenzi bbovenzi added the backport-to-v3-4-test Backport to v3-4-test label Oct 21, 2026
@bbovenzi bbovenzi added this to the Airflow 3.4.0 milestone Oct 21, 2026
@bbovenzi
bbovenzi merged commit 8070289 into apache:main Oct 21, 2026
89 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

vatsrahul1001 pushed a commit that referenced this pull request Oct 22, 2026
…72604) (#75323)

* [v3-4-test] UI: Render Arabic durations with the correct plural form (#72604)

Arabic inflects a counted noun four ways, but dayjs's `ar` locale stores a
single template per unit, so every count above one took the 3-10 form: a
two-hour deadline read "2 ساعات" where the dual "ساعتان" is required, and an
eleven-day one read "11 أيام" instead of "11 يومًا".

Locales with comparable plural systems -- Hebrew, Russian, Polish -- already
pass a function instead of a template and render correctly at every count;
Arabic was simply never migrated. This applies the same treatment locally
until the fix can be made upstream.

Two assertions from the previous change pinned the uninflected output and are
updated here.
(cherry picked from commit 8070289)

Co-authored-by: Baha Bouali <baha.bouali2020@gmail.com>

* UI: Drop Arabic plural test cases that no longer go through dayjs (#75330)

(cherry picked from commit a3a4c13)

---------

Co-authored-by: Baha Bouali <baha.bouali2020@gmail.com>
Co-authored-by: Yuseok Jo <yuseok89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-4-test Backport to v3-4-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants