Skip to content

fix(web): load Arabic and Lao date locales - #45571

Merged
crazywoola merged 1 commit into
langgenius:mainfrom
0718lol:fix/arabic-lao-date-locales
Nov 6, 2026
Merged

crazywoola merged 1 commit into
langgenius:mainfrom
0718lol:fix/arabic-lao-date-locales

Conversation

@0718lol

@0718lol 0718lol commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #45570.

Monitoring date labels and timestamps fall back to English for Arabic (ar-TN) and Lao (lo-LA), even though both display languages already have entries in localeMap. Load their Day.js locale modules alongside the other supported locales so the existing formatter can resolve them.

Add regression cases through the real formatToLocalTime utility for the Arabic and Lao January month names, plus an English control. No translation keys, locale mappings or global default locale are changed.

Validation

  • Node 24.22.1; pinned pnpm 12.16.1; Vitest 5.1.0.
  • vp test run --project unit utils/format.spec.ts --maxWorkers=2 (from web/): before the locale imports, 2 failed and 16 passed; after the change, all 18 passed.
  • vp run -w check: passed, with 0 errors and 1,228 repository-wide lint warnings.
  • vp run dify-web#type-check: passed.
  • vp staged: passed, including the pre-commit hook.
  • git diff --check: passed.

Validation uses the production formatter in the native unit runner. A full deployed app/browser journey was not run. Real callers include monitoring date-range labels and useTimestamp.

Screenshots

No browser screenshots were captured. The focused regression establishes the formatting difference:

Selected language Before (MMMM) After (MMMM)
ar-TN January يناير
lo-LA January ມັງກອນ
en-US January January

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've verified the change and added or updated tests where meaningful regression risk justifies coverage.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and vp staged (frontend) to appease the lint gods

Frontend-only: vp staged and the Web type check ran; backend checks do not apply. No user documentation update is needed for this locale-loading fix.

AI assistance: Codex assisted with investigation, implementation, tests and drafting. Actual validation and its limits are reported above.

From Codex

@github-actions github-actions Bot added size:S This PR changes 10-29 lines, ignoring generated files. web This relates to changes on the web. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Nov 4, 2026
@crazywoola
crazywoola enabled auto-merge November 6, 2026 03:31
@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.87%. Comparing base (cf7ac61) to head (309daaa).
⚠️ Report is 53 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #45571      +/-   ##
==========================================
+ Coverage   89.86%   89.87%   +0.01%     
==========================================
  Files        6243     6243              
  Lines      391178   391080      -98     
  Branches    79209    78429     -780     
==========================================
- Hits       351528   351482      -46     
+ Misses      33546    33494      -52     
  Partials     6104     6104              
Flag Coverage Δ
dify-ui 92.53% <ø> (ø)
web 89.96% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@crazywoola
crazywoola added this pull request to the merge queue Nov 6, 2026
Merged via the queue into langgenius:main with commit 9dd42b0 Nov 6, 2026
53 of 54 checks passed
fatelei pushed a commit to fatelei/dify that referenced this pull request Nov 9, 2026
@wylswz wylswz mentioned this pull request Nov 17, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Date formatting falls back to English for Arabic and Lao locales

2 participants