feat: Auto-detect the user's language or set a default language. #711

Closed
opened 2025-11-11 14:29:33 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @PasserDreamer on GitHub (Apr 24, 2024).

Is your feature request related to a problem? Please describe.
When accessing the WebUI for the first time or from another device, the language is set to English, and it remains unchanged even after login, even if the language setting was previously altered during an earlier session.

Describe the solution you'd like
Allow the WebUI to detect the user's browser language and automatically change the locale.
Add an environment variable WEBUI_LANGUAGE to set a default language.

Originally created by @PasserDreamer on GitHub (Apr 24, 2024). **Is your feature request related to a problem? Please describe.** When accessing the WebUI for the first time or from another device, the language is set to English, and it remains unchanged even after login, even if the language setting was previously altered during an earlier session. **Describe the solution you'd like** Allow the WebUI to detect the user's browser language and automatically change the locale. Add an environment variable ```WEBUI_LANGUAGE``` to set a default language.
Author
Owner

@justinh-rahb commented on GitHub (Apr 24, 2024):

Edit backend/config.json or use this command for Docker install:

docker exec -it open-webui sed -i 's/"en-US"/"<locale>"/g' /app/backend/data/config.json
@justinh-rahb commented on GitHub (Apr 24, 2024): Edit `backend/config.json` or use this command for Docker install: ```bash docker exec -it open-webui sed -i 's/"en-US"/"<locale>"/g' /app/backend/data/config.json ```
Author
Owner

@tjbck commented on GitHub (May 26, 2024):

Added to our dev branch!

@tjbck commented on GitHub (May 26, 2024): Added to our dev branch!
Author
Owner

@saxsoares commented on GitHub (Jun 5, 2024):

Despite the "Auto-detect" user's language.... How to force a default language?

@saxsoares commented on GitHub (Jun 5, 2024): Despite the "Auto-detect" user's language.... How to force a default language?
Author
Owner

@omeryounus commented on GitHub (Oct 19, 2024):

this command didn't work --> docker exec -it open-webui sed -i 's/"en-US"/""/g' /app/backend/data/config.json
error out as...

docker exec -it open-webui sed -i 's/"en-US"/"<locale>"/g' /app/backend/data/config.json
sed: -e expression #1, char 1: unknown command: `''

What's next:
    Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug open-webui
    Learn more at https://docs.docker.com/go/debug-cli/

@omeryounus commented on GitHub (Oct 19, 2024): this command didn't work --> docker exec -it open-webui sed -i 's/"en-US"/"<locale>"/g' /app/backend/data/config.json error out as... ``` docker exec -it open-webui sed -i 's/"en-US"/"<locale>"/g' /app/backend/data/config.json sed: -e expression #1, char 1: unknown command: `'' What's next: Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug open-webui Learn more at https://docs.docker.com/go/debug-cli/ ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#711