Repository navigation
feat(i18n): add LOCALAI_DEFAULT_LANGUAGE (--default-language) option - #13369
Open
AnythingLinux wants to merge 4 commits into
Open
AnythingLinux wants to merge 4 commits into
AnythingLinux wants to merge 4 commits into
Conversation
AnythingLinux
force-pushed
the
feat/default-language-config
branch
from
November 21, 2026 00:25
9a44fce to
fa2aa7b
Compare
AnythingLinux
marked this pull request as draft
November 21, 2026 00:28
AnythingLinux
force-pushed
the
feat/default-language-config
branch
5 times, most recently
from
November 21, 2026 06:42
f72387a to
a3789e6
Compare
Contributor
Author
|
Hi @mudler, this PR is ready for review! It implements #13331 by adding Please let me know if any adjustments or additional tests are needed.
|
AnythingLinux
marked this pull request as ready for review
November 21, 2026 19:47
… flag Signed-off-by: Karim <linuxguns@gmail.com>
Signed-off-by: Karim <linuxguns@gmail.com>
Signed-off-by: Karim <linuxguns@gmail.com>
AnythingLinux
force-pushed
the
feat/default-language-config
branch
from
November 21, 2026 20:02
a3789e6 to
804f824
Compare
Signed-off-by: Karim <linuxguns@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Description
Closes #13331
Adds a server-level
LOCALAI_DEFAULT_LANGUAGE(--default-language) configuration option, allowing administrators and production deployers to define the default UI language without requiring users to configure it manually.The configured language is applied across the LocalAI web interface, including the login, registration, and home pages, while preserving explicit language preferences selected by users.
Summary of Changes
core/config,core/cli): AddedDefaultLanguagetoBrandingConfig/RuntimeSettings, includingWithDefaultLanguageand runtime settings persistence. Exposed the--default-languageCLI flag andLOCALAI_DEFAULT_LANGUAGEenvironment variable.core/http/endpoints/localai/branding.go): Exposeddefault_languagethroughGET /api/branding, allowing unauthenticated pages such as login and registration to receive the configured language.core/http/react-ui): Integrated the server-configured language from/api/brandingusingi18n.changeLanguage(...), provided that the value is valid and supported by the frontend.docs/content/): Documented the--default-languageCLI flag,LOCALAI_DEFAULT_LANGUAGEenvironment variable, supported locale codes, and language preference precedence.Language Preference Precedence
The language selection follows this order:
?lng=<code>)localStorage(localai-language)LOCALAI_DEFAULT_LANGUAGE, if valid and supporteden) as the fallbackUnsupported or invalid server-configured language values are ignored gracefully.
The implementation supports the currently available frontend locales:
en,it,es,de,zh-CN,id,ko,pt-BR,fr,bnConfiguration Example
Set the default language using an environment variable:
Or use the CLI flag:
Notes for Reviewers
LOCALAI_DEFAULT_LANGUAGEis not configured.Checklist
docs/content/for user-facing changes, or not applicable.