Skip to content

Conversation

@RoyBA
Copy link
Contributor

@RoyBA RoyBA commented Nov 30, 2025

Summary

Adds support for configuring a UI language in config.toml that overrides browser language preferences. This allows applications to force a specific language for all users.

Changes

  • Added language optional field to UISettings class in config.py
  • Added commented language example in the default config template
  • Updated /project/translations endpoint to use config.ui.language when set, falling back to browser language otherwise
  • Updated /project/settings endpoint to use the same language override logic for markdown, chat profiles, and starters

Usage

To force a specific language for all users, add this to your config.toml:

[UI]
language = "he-IL"  # or any other valid language code like "en-US", "fr-FR", etc.

Summary by cubic

Adds a UI language setting in config.toml to override the browser language for all users. Translations, markdown, chat profiles, and starters now load using the configured language when set.

  • New Features

    • Added optional language to UISettings and the default config template.
    • /project/translations and /project/settings use config.ui.language when set, otherwise fall back to the requested/browser language.
    • No change in behavior if language is unset.
  • Migration

    • To force a language for all users, set [UI] language = "en-US" (or any valid locale) in config.toml.

Written for commit 6f5c9eb. Summary will update automatically on new commits.

When default_language is set in [UI] section of config.toml, the
application will use that language for all users instead of their
browser's language preference.
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. backend Pertains to the Python backend. enhancement New feature or request labels Nov 30, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@RoyBA RoyBA changed the title Add language configuration option to override browser language feat: Add language configuration option to override browser language Nov 30, 2025
@hayescode hayescode added this pull request to the merge queue Dec 4, 2025
Merged via the queue into Chainlit:main with commit 5b0abea Dec 4, 2025
24 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Pertains to the Python backend. enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants