[PR #1313] [MERGED] feat: Configurable i18n default translation language #7429

Closed
opened 2025-11-11 17:26:08 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/1313
Author: @asedmammad
Created: 3/26/2024
Status: Merged
Merged: 3/28/2024
Merged by: @tjbck

Base: devHead: feat/i18n-navigator-config


📝 Commits (3)

  • 26121c5 wip: Set default language from config
  • 64e6003 refac: Remove translation values for en-US
  • 0c021e4 rename config key to default_locale

📊 Changes

5 files changed (+370 additions, -360 deletions)

View changed files

📝 backend/data/config.json (+1 -0)
📝 backend/main.py (+2 -4)
📝 src/lib/i18n/index.ts (+30 -24)
📝 src/lib/i18n/locales/en-US/translation.json (+331 -331)
📝 src/routes/+layout.svelte (+6 -1)

📄 Description

Pull Request Checklist

  • Description: Briefly describe the changes in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.

Description

This pull request introduces the ability for users to control i18n translation during deployment, resolving issue #1256. Previously, i18n only automatically detected the local language and applied corresponding translated content. With this change, users can now decide whether to enable this feature or set a default language during the deployment phase by settingconfig.json.


I was not sure about returning default_locale in /api/config, maybe @tjbck can help with comments on this.

Changelog Entry

Added

  • Added default_locale to config.json and return it as backendConfig to the UI.

Fixed

  • Removed translation values for en-US as they are not necessary (keys are used as fallback).

Changed

  • Use default_locale if it's present, and navigator's language otherwise.

🔄 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/1313 **Author:** [@asedmammad](https://github.com/asedmammad) **Created:** 3/26/2024 **Status:** ✅ Merged **Merged:** 3/28/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `feat/i18n-navigator-config` --- ### 📝 Commits (3) - [`26121c5`](https://github.com/open-webui/open-webui/commit/26121c5d881b2d34ed90eb0cca0abb4edabe07ff) wip: Set default language from config - [`64e6003`](https://github.com/open-webui/open-webui/commit/64e60036275a5200faeade6112c62bc91e30389f) refac: Remove translation values for en-US - [`0c021e4`](https://github.com/open-webui/open-webui/commit/0c021e42f5c4f50444d6223221a884c5c7501ddf) rename config key to default_locale ### 📊 Changes **5 files changed** (+370 additions, -360 deletions) <details> <summary>View changed files</summary> 📝 `backend/data/config.json` (+1 -0) 📝 `backend/main.py` (+2 -4) 📝 `src/lib/i18n/index.ts` (+30 -24) 📝 `src/lib/i18n/locales/en-US/translation.json` (+331 -331) 📝 `src/routes/+layout.svelte` (+6 -1) </details> ### 📄 Description ## Pull Request Checklist - [X] **Description:** Briefly describe the changes in this pull request. - [X] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. --- ## Description This pull request introduces the ability for users to control i18n translation during deployment, resolving issue #1256. Previously, i18n only automatically detected the local language and applied corresponding translated content. With this change, users can now decide whether to enable this feature or set a default language during the deployment phase by setting`config.json`. --- I was not sure about returning `default_locale` in `/api/config`, maybe @tjbck can help with comments on this. ### Changelog Entry ### Added - Added `default_locale` to `config.json` and return it as backendConfig to the UI. ### Fixed - Removed translation values for `en-US` as they are not necessary (keys are used as fallback). ### Changed - Use default_locale if it's present, and `navigator`'s language otherwise. --- <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 2025-11-11 17:26:08 -06: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#7429