Set the default language based on the Browser #1370

Closed
opened 2025-11-11 14:43:45 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @RodriMora on GitHub (Jun 25, 2024).

Is your feature request related to a problem? Please describe.
At the moment it defaults to English

Describe the solution you'd like
Use something like js navigator.language to set the default Open-webui language

Describe alternatives you've considered
Use the browser language for the default language for the login page, but if the user changes it, respect it for the duration of the session. I think that would be the best UX

Originally created by @RodriMora on GitHub (Jun 25, 2024). **Is your feature request related to a problem? Please describe.** At the moment it defaults to English **Describe the solution you'd like** Use something like js `navigator.language` to set the default Open-webui language **Describe alternatives you've considered** Use the browser language for the default language for the login page, but if the user changes it, respect it for the duration of the session. I think that would be the best UX
Author
Owner

@silentoplayz commented on GitHub (Jun 25, 2024):

Possibly related, but not clear enough for me to make that decision on my own. I will still link the merged PR here for your own viewing: https://github.com/open-webui/open-webui/pull/1313

@silentoplayz commented on GitHub (Jun 25, 2024): Possibly related, but not clear enough for me to make that decision on my own. I will still link the merged PR here for your own viewing: https://github.com/open-webui/open-webui/pull/1313
Author
Owner

@RodriMora commented on GitHub (Jun 25, 2024):

Possibly related, but not clear enough for me to make that decision on my own. I will still link the merged PR here for your own viewing: #1313

I believe at the moment openwebui defaults to english not matter your OS or Browser settings. That's OK for the admin but not for the endusers if planning to deploy it to more people, as if someone doens't know english they probably would have a hard time looking for the setting to change it.

I believe it's better UX to default to the OS/Browser language to ensure the user understands it. But then if the user changes it in the settings, respect that election while he is logged on.

If I have time I'll try to submit a PR.

@RodriMora commented on GitHub (Jun 25, 2024): > Possibly related, but not clear enough for me to make that decision on my own. I will still link the merged PR here for your own viewing: #1313 I believe at the moment openwebui defaults to english not matter your OS or Browser settings. That's OK for the admin but not for the endusers if planning to deploy it to more people, as if someone doens't know english they probably would have a hard time looking for the setting to change it. I believe it's better UX to default to the OS/Browser language to ensure the user understands it. But then if the user changes it in the settings, respect that election while he is logged on. If I have time I'll try to submit a PR.
Author
Owner

@tjbck commented on GitHub (Jun 25, 2024):

Are you on the latest version? Language auto detection should be enabled by default: 9e4dd4b86f/src/routes/%2Blayout.svelte (L65)

@tjbck commented on GitHub (Jun 25, 2024): Are you on the latest version? Language auto detection should be enabled by default: https://github.com/open-webui/open-webui/blob/9e4dd4b86f77653b59dc1fa97fe3f72e8252b359/src/routes/%2Blayout.svelte#L65
Author
Owner

@RodriMora commented on GitHub (Jun 25, 2024):

Are you on the latest version? Language auto detection should be enabled by default:

9e4dd4b86f/src/routes/%2Blayout.svelte (L65)

Hi! thanks for the response. I didn't notice this was already implemented as I just tested manually. This is what I've found with the info you provided.

Yes, latest version. I just checked and navigator.languages can output non-default languages-combos
This is in Edge:
image
This is in Chrome:
image

It seems like:
navigator.languages[0]
in this case would pick "es" which doesn't correspond to any of the list compatible with openwebui
image

Maybe looping for the output of navigator.languages until there is a match would be a better solution?

@RodriMora commented on GitHub (Jun 25, 2024): > Are you on the latest version? Language auto detection should be enabled by default: > > https://github.com/open-webui/open-webui/blob/9e4dd4b86f77653b59dc1fa97fe3f72e8252b359/src/routes/%2Blayout.svelte#L65 Hi! thanks for the response. I didn't notice this was already implemented as I just tested manually. This is what I've found with the info you provided. Yes, latest version. I just checked and `navigator.languages ` can output non-default languages-combos This is in Edge: ![image](https://github.com/open-webui/open-webui/assets/5622210/6f5bf302-6bba-4ab7-9907-4389ffc76619) This is in Chrome: ![image](https://github.com/open-webui/open-webui/assets/5622210/d74e1003-1184-43a6-bfd7-9d77ea8a77ae) It seems like: `navigator.languages[0]` in this case would pick "es" which doesn't correspond to any of the list compatible with openwebui <img width="518" alt="image" src="https://github.com/open-webui/open-webui/assets/5622210/88744275-c2bb-4e5f-9aaa-e684280b7220"> Maybe looping for the output of navigator.languages until there is a match would be a better solution?
Author
Owner

@tjbck commented on GitHub (Jun 25, 2024):

Feel free to make a PR!

@tjbck commented on GitHub (Jun 25, 2024): Feel free to make a PR!
Author
Owner

@tjbck commented on GitHub (Jun 30, 2024):

Should be fixed on dev!

@tjbck commented on GitHub (Jun 30, 2024): Should be fixed on dev!
Author
Owner

@cyberluke commented on GitHub (Feb 17, 2025):

What if my browser is set to English but in open-webui I choose another language? Shouldn't it take user's language from open-webui settings?

@cyberluke commented on GitHub (Feb 17, 2025): What if my browser is set to English but in open-webui I choose another language? Shouldn't it take user's language from open-webui settings?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#1370