mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-11 10:34:13 -05:00
[GH-ISSUE #17357] issue: Dayjs does not localize according to selected language #121565
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ShirasawaSama on GitHub (Sep 11, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/17357
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
dev
Ollama Version (if applicable)
Not used
Operating System
macOS 26
Browser (if applicable)
Edge 141
Confirmation
README.md.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
Logs & Screenshots
Additional Information
The issue is caused by Dayjs not properly applying the selected language for localization.
@rgaricano commented on GitHub (Sep 12, 2025):
working on it
@ShirasawaSama commented on GitHub (Sep 12, 2025):
@rgaricano
@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!
@rgaricano commented on GitHub (Sep 12, 2025):
I have to finish the PR:


@ShirasawaSama commented on GitHub (Sep 12, 2025):
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 toToday noon 12:47)I'm not sure if there's a better Day.js built-in function for this.
@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",NOTE: changed new string to
YYYY年MM月DD日[下午]A h:mm@rgaricano commented on GitHub (Sep 12, 2025):
@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",@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",
@ShirasawaSama commented on GitHub (Sep 12, 2025):
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.
👍
@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": "",
@rgaricano commented on GitHub (Sep 12, 2025):
Addressed with commit
2227f24bd6With 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!)