baha-bouali opened a new pull request, #72309:
URL: https://github.com/apache/airflow/pull/72309

   closes: #72307
   
   The deadline tooltip was assembled from two separate catalogues: the sentence
   template and the reference point come from i18next, but the interval came 
from
   dayjs. Since the UI never called `dayjs.locale()`, dayjs stayed on its 
built-in
   English and rendered "2 hours" inside an otherwise fully translated sentence.
   No translation key was missing, which is why the completeness checks never
   caught it.
   
   This syncs dayjs's locale to the language i18next resolves, which also fixes
   every relative time in the UI (e.g. "Next Run") which is the same root cause.
   
   
   
   
   ### Before (e.g., ARABIC)
   
   <img width="533" height="158" alt="image" 
src="https://github.com/user-attachments/assets/2c1cf6f4-462c-411d-af84-67e76dc93cd4";
 />
   
   ### After
   
   <img width="532" height="216" alt="image" 
src="https://github.com/user-attachments/assets/288a2b87-2caa-4a81-b2ee-53003a836bc8";
 />
   
   
   ### Before (e.g., FRENCH)
   
   <img width="821" height="301" alt="image" 
src="https://github.com/user-attachments/assets/f678c78c-8313-436e-a26d-c23691cf59e2";
 />
   
   ### After
   
   <img width="678" height="232" alt="image" 
src="https://github.com/user-attachments/assets/a73b09dc-5441-41cd-93a2-19051d895b6e";
 />
   
   ### Notes
   
   - The locale data is imported eagerly rather than on demand. react-i18next
     re-renders synchronously on `languageChanged`, so a dynamic import would
     resolve after that render and leave the previous language's durations on
     screen. All 20 locale files together are ~7.6 kB gzipped.
   - The listener is registered before `init()` because i18next emits
     `languageChanged` from init itself, and because emitter callbacks run in
     subscription order. 
   - A test asserts the locale map covers exactly `supportedLanguages`, so 
adding
     a language without a dayjs mapping fails CI.
   - The fourth file is a one-line addition to the 
`check-for-inclusive-language`
     exclude list. In fact, the hook rejects the bare Hebrew code `he`. 
`config.ts` is
     already excluded for the same reason.
   
   ### Known limitation. cc @hussein-awala 
   dayjs's Arabic locale has no dual form. It only defines `%d ساعات`. 
   So **two hours** renders as **"2 ساعات"** rather than **"ساعتان"**. The 
language is now correct;
   the grammar is as good as dayjs's own locale data allows. Fixing that 
properly
   means moving durations to `Intl.DurationFormat` or to i18next plural keys,
   which have their own trade-offs and are out of scope here.
   
   I am happy to work on the follow-up if maintainers agree on the approach.
   
   `renderCompactDuration` still emits hardcoded English unit letters (`2h 30m`)
   and is untouched by this change.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to