[PR #22454] [MERGED] fix: use static month names in getTimeRange to prevent OS locale leaking into sidebar #26708

Closed
opened 2026-04-20 06:39:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22454
Author: @Classic298
Created: 3/8/2026
Status: Merged
Merged: 3/8/2026
Merged by: @tjbck

Base: devHead: fix/sidebar-month-locale


📝 Commits (1)

  • 3c09ed4 fix: use static month names in getTimeRange to prevent OS locale leaking into sidebar

📊 Changes

1 file changed (+17 additions, -1 deletions)

View changed files

📝 src/lib/utils/index.ts (+17 -1)

📄 Description

getTimeRange returns month names that are used as i18n translation keys (consumed via .t(chat.time_range) in the sidebar, search modal, etc.). The keys must be exact English strings like 'January', 'February', etc.

Previously, toLocaleString('default', { month: 'long' }) was used to generate these keys. The 'default' locale defers to the browser's locale resolution, which in Firefox with intl.regional_prefs.use_os_locales=true picks up OS regional settings instead of the browser language. This caused German month names (e.g. 'Februar', 'Januar') to appear in the sidebar for users whose OS region is set to Germany, even when both browser and app language are set to English. Chrome was unaffected because it ignores OS regional settings for the 'default' locale.

Since i18n has no translation key for 'Februar', the German string passed through untranslated. Replace toLocaleString with a static MONTH_NAMES array lookup to make the intent explicit and eliminate any browser/OS locale dependency.

Contributor License Agreement

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22454 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 3/8/2026 **Status:** ✅ Merged **Merged:** 3/8/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix/sidebar-month-locale` --- ### 📝 Commits (1) - [`3c09ed4`](https://github.com/open-webui/open-webui/commit/3c09ed415ecf1bdda4d4401b5a9b064f0b2275ae) fix: use static month names in getTimeRange to prevent OS locale leaking into sidebar ### 📊 Changes **1 file changed** (+17 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/utils/index.ts` (+17 -1) </details> ### 📄 Description getTimeRange returns month names that are used as i18n translation keys (consumed via \.t(chat.time_range) in the sidebar, search modal, etc.). The keys must be exact English strings like 'January', 'February', etc. Previously, toLocaleString('default', { month: 'long' }) was used to generate these keys. The 'default' locale defers to the browser's locale resolution, which in Firefox with intl.regional_prefs.use_os_locales=true picks up OS regional settings instead of the browser language. This caused German month names (e.g. 'Februar', 'Januar') to appear in the sidebar for users whose OS region is set to Germany, even when both browser and app language are set to English. Chrome was unaffected because it ignores OS regional settings for the 'default' locale. Since i18n has no translation key for 'Februar', the German string passed through untranslated. Replace toLocaleString with a static MONTH_NAMES array lookup to make the intent explicit and eliminate any browser/OS locale dependency. ### Contributor License Agreement <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. Your PR will NOT be reviewed or merged until you check the box below confirming that you have read and agree to the terms of the CLA. --> - [X] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 06:39:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#26708