[GH-ISSUE #17357] issue: Dayjs does not localize according to selected language #72858

Closed
opened 2026-05-13 05:03:10 -05:00 by GiteaMirror · 11 comments
Owner

Originally created by @ShirasawaSama on GitHub (Sep 11, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/17357

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Git Clone

Open WebUI Version

dev

Ollama Version (if applicable)

Not used

Operating System

macOS 26

Browser (if applicable)

Edge 141

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

Dayjs should display dates and times in the language selected in the Open WebUI settings.

Actual Behavior

Dayjs does not localize the date/time; it does not follow the language chosen by the user.

Steps to Reproduce

  1. Start Open WebUI on any supported platform.
  2. Change the language setting to a non-English language (e.g., Chinese).
  3. Observe any date or time shown in the UI.
  4. The date/time is not localized to the selected language.

Logs & Screenshots

Image

Additional Information

The issue is caused by Dayjs not properly applying the selected language for localization.

Originally created by @ShirasawaSama on GitHub (Sep 11, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/17357 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Git Clone ### Open WebUI Version dev ### Ollama Version (if applicable) Not used ### Operating System macOS 26 ### Browser (if applicable) Edge 141 ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior Dayjs should display dates and times in the language selected in the Open WebUI settings. ### Actual Behavior Dayjs does not localize the date/time; it does not follow the language chosen by the user. ### Steps to Reproduce 1. Start Open WebUI on any supported platform. 2. Change the language setting to a non-English language (e.g., Chinese). 3. Observe any date or time shown in the UI. 4. The date/time is not localized to the selected language. ### Logs & Screenshots <img width="444" height="120" alt="Image" src="https://github.com/user-attachments/assets/f625102e-2b3b-4cdc-8e0b-484bbb2a782c" /> ### Additional Information The issue is caused by Dayjs not properly applying the selected language for localization.
GiteaMirror added the bug label 2026-05-13 05:03:10 -05:00
Author
Owner

@rgaricano commented on GitHub (Sep 12, 2025):

working on it

Image
Image
Image

<!-- gh-comment-id:3283105925 --> @rgaricano commented on GitHub (Sep 12, 2025): working on it ![Image](https://github.com/user-attachments/assets/5e96dd91-4e1f-4b0a-877e-0ac8f7506eb8) ![Image](https://github.com/user-attachments/assets/4dfc2f44-0d0a-45f9-8a36-cba8d67eac8f) ![Image](https://github.com/user-attachments/assets/e4fde3d3-abe7-4e51-a0cb-92a5bf37bd12)
Author
Owner

@ShirasawaSama commented on GitHub (Sep 12, 2025):

@rgaricano

Image
<!-- gh-comment-id:3284134514 --> @ShirasawaSama commented on GitHub (Sep 12, 2025): @rgaricano <img width="1056" height="252" alt="Image" src="https://github.com/user-attachments/assets/cc3e76dc-79fb-4999-9cb5-059ba102b6de" />
Author
Owner

@rgaricano commented on GitHub (Sep 12, 2025):

Yes, I convert the PR to draft because there are a more straight way (just modifing dayjs without add more files),
& also is hardcoded in
a156033d3c/src/lib/utils/index.ts (L379-L390)

but it's necessary to add manually the string to all locales, i18n:parse don't add it. (I did with a script)
I'm testing!

<!-- gh-comment-id:3284501206 --> @rgaricano commented on GitHub (Sep 12, 2025): Yes, I convert the PR to draft because there are a more straight way (just modifing dayjs without add more files), & also is hardcoded in https://github.com/open-webui/open-webui/blob/a156033d3c2b7baff98a519940aa87137d2c2b4c/src/lib/utils/index.ts#L379-L390 but it's necessary to add manually the string to all locales, i18n:parse don't add it. (I did with a script) I'm testing!
Author
Owner

@rgaricano commented on GitHub (Sep 12, 2025):

I have to finish the PR:
Image
Image

<!-- gh-comment-id:3284901495 --> @rgaricano commented on GitHub (Sep 12, 2025): I have to finish the PR: ![Image](https://github.com/user-attachments/assets/e657002f-7e2f-43f4-8fee-6792d93bac82) ![Image](https://github.com/user-attachments/assets/8cac24e3-4ece-4230-bfcc-101fa0359f3a)
Author
Owner

@ShirasawaSama commented on GitHub (Sep 12, 2025):

I have to finish the PR: Image Image

Very good, thanks, but this doesn't quite match the word order of specific languages. For example, in Chinese it should be:

今天中午 12:47 (Directly translated into English is similar to Today noon 12:47)

I'm not sure if there's a better Day.js built-in function for this.

<!-- gh-comment-id:3284947056 --> @ShirasawaSama commented on GitHub (Sep 12, 2025): > I have to finish the PR: ![Image](https://github.com/user-attachments/assets/e657002f-7e2f-43f4-8fee-6792d93bac82) ![Image](https://github.com/user-attachments/assets/8cac24e3-4ece-4230-bfcc-101fa0359f3a) Very good, thanks, but this doesn't quite match the word order of specific languages. For example, in Chinese it should be: `今天中午 12:47` (Directly translated into English is similar to `Today noon 12:47`) I'm not sure if there's a better Day.js built-in function for this.
Author
Owner

@rgaricano commented on GitHub (Sep 12, 2025):

I made a new PR (previous descarted), I translated string also to chinesse (cont&tw) for test, please revise.
"DD/MM/YYYY [at] h:mm A": "YYYY年MM月DD日[下午]h:mm A",

Image

NOTE: changed new string to YYYY年MM月DD日[下午]A h:mm

<!-- gh-comment-id:3285540849 --> @rgaricano commented on GitHub (Sep 12, 2025): I made a new PR (previous descarted), I translated string also to chinesse (cont&tw) for test, please revise. `"DD/MM/YYYY [at] h:mm A": "YYYY年MM月DD日[下午]h:mm A",` ![Image](https://github.com/user-attachments/assets/f88bb947-a0eb-4d17-a276-c1a89bf2f6ea) NOTE: changed new string to `YYYY年MM月DD日[下午]A h:mm`
Author
Owner

@rgaricano commented on GitHub (Sep 12, 2025):

I have to finish the PR: Image Image

Very good, thanks, but this doesn't quite match the word order of specific languages. For example, in Chinese it should be:

今天中午 12:47 (Directly translated into English is similar to Today noon 12:47)

I'm not sure if there's a better Day.js built-in function for this.

@ShirasawaSama
I didn't change this string, it wasn't necessary for the PR, you can change it in next translation PR,
now: "[Last] dddd [at] h:mm A": "[上次] dddd [于] h:mm A",
Proposal: "[Last] dddd [at] h:mm A": "[上次] ddddA h:mm",

<!-- gh-comment-id:3285582479 --> @rgaricano commented on GitHub (Sep 12, 2025): > > I have to finish the PR: ![Image](https://github.com/user-attachments/assets/e657002f-7e2f-43f4-8fee-6792d93bac82) ![Image](https://private-user-images.githubusercontent.com/131402327/488807025-8cac24e3-4ece-4230-bfcc-101fa0359f3a.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTc2ODgzMDUsIm5iZiI6MTc1NzY4ODAwNSwicGF0aCI6Ii8xMzE0MDIzMjcvNDg4ODA3MDI1LThjYWMyNGUzLTRlY2UtNDIzMC1iZmNjLTEwMWZhMDM1OWYzYS5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwOTEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDkxMlQxNDQwMDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hNTczYTAxMjliZTU1NDE5ZGZlNWViMGIwZjA2OGQxOGUzY2MzNDAzNGE0YzMxZWRiYTcwZWYzNWU1OGEzNDhhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.bI_m3X36PiMtvcGJsumq__Z5n39ncYROAPNOYy_BJrs) > > Very good, thanks, but this doesn't quite match the word order of specific languages. For example, in Chinese it should be: > > `今天中午 12:47` (Directly translated into English is similar to `Today noon 12:47`) > > I'm not sure if there's a better Day.js built-in function for this. @ShirasawaSama I didn't change this string, it wasn't necessary for the PR, you can change it in next translation PR, now: `"[Last] dddd [at] h:mm A": "[上次] dddd [于] h:mm A",` Proposal: `"[Last] dddd [at] h:mm A": "[上次] ddddA h:mm",`
Author
Owner

@rgaricano commented on GitHub (Sep 12, 2025):

@ShirasawaSama
with "DD/MM/YYYY [at] h:mm A": "YYYY年MM月DD日[下午]A h:mm"
& "[Last] dddd [at] h:mm A": "[上次] ddddA h:mm",

Image

<!-- gh-comment-id:3285992858 --> @rgaricano commented on GitHub (Sep 12, 2025): @ShirasawaSama with "DD/MM/YYYY [at] h:mm A": "YYYY年MM月DD日[下午]A h:mm" & "[Last] dddd [at] h:mm A": "[上次] ddddA h:mm", ![Image](https://github.com/user-attachments/assets/7de2b663-a1a4-4256-b4d2-9d75e6fdafd4)
Author
Owner

@ShirasawaSama commented on GitHub (Sep 12, 2025):

@ShirasawaSama with "DD/MM/YYYY [at] h:mm A": "YYYY年MM月DD日[下午]A h:mm" & "[Last] dddd [at] h:mm A": "[上次] ddddA h:mm",

Image

Thanks.

Do you think it's reasonable to switch this formatting string based on different languages? I'd actually like to get your opinion on this.

I haven't looked at the code yet, so I'm not sure if it might make the code more complex.

Time-related i18n strings already exist. So it seems like there's no problem.

👍

<!-- gh-comment-id:3286017348 --> @ShirasawaSama commented on GitHub (Sep 12, 2025): > [@ShirasawaSama](https://github.com/ShirasawaSama) with "DD/MM/YYYY [at] h:mm A": "YYYY年MM月DD日[下午]A h:mm" & "[Last] dddd [at] h:mm A": "[上次] ddddA h:mm", > > ![Image](https://github.com/user-attachments/assets/7de2b663-a1a4-4256-b4d2-9d75e6fdafd4) Thanks. ~~Do you think it's reasonable to switch this formatting string based on different languages? I'd actually like to get your opinion on this.~~ ~~I haven't looked at the code yet, so I'm not sure if it might make the code more complex.~~ Time-related i18n strings already exist. So it seems like there's no problem. 👍
Author
Owner

@rgaricano commented on GitHub (Sep 12, 2025):

For me, yes, of course. For example, I prefer a 24-hour format... I just have to change the h:mm string to HH:mm.

And it would be better if these strings were directly configurable in the UI. This would allow for customization and also avoid having to add them manually (since they're complex, they're not processed when i18n:parse is used), which is still an inconvenience.

Yes, those are in translation file:
"[Today at] h:mm A": "",
"[Yesterday at] h:mm A": "",
"[Last] dddd [at] h:mm A": "",
"DD/MM/YYYY [at] h:mm A": "",

<!-- gh-comment-id:3286042582 --> @rgaricano commented on GitHub (Sep 12, 2025): For me, yes, of course. For example, I prefer a 24-hour format... I just have to change the h:mm string to HH:mm. And it would be better if these strings were directly configurable in the UI. This would allow for customization and also avoid having to add them manually (since they're complex, they're not processed when i18n:parse is used), which is still an inconvenience. Yes, those are in translation file: "[Today at] h:mm A": "", "[Yesterday at] h:mm A": "", "[Last] dddd [at] h:mm A": "", "DD/MM/YYYY [at] h:mm A": "",
Author
Owner

@rgaricano commented on GitHub (Sep 12, 2025):

Addressed with commit 2227f24bd6

With my PR I intended to group a bit towards $lib/dayjs, this commit is more straight.

I think that this issue can be closed.
(Sometimes it's neccessary refresh the page after change interface language!)

<!-- gh-comment-id:3287114068 --> @rgaricano commented on GitHub (Sep 12, 2025): Addressed with commit https://github.com/open-webui/open-webui/commit/2227f24bd6d861b1fad8d2cabacf7d62ce137d0c With my PR I intended to group a bit towards $lib/dayjs, this commit is more straight. I think that this issue can be closed. (Sometimes it's neccessary refresh the page after change interface language!)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#72858