b2ee9df fix: correct Azure TTS locale extraction for SSML xml:lang
📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝backend/open_webui/routers/audio.py (+1 -1)
📄 Description
Description
Fixed incorrect locale extraction in Azure TTS SSML generation. split("-")[:1] only takes the first segment (e.g., "en" from "en-US"), producing an invalid SSML xml:lang attribute. Changed to [:2] to preserve the full locale (e.g., "en-US").
Fixed
Azure TTS now correctly uses the full locale (e.g., "en-US") in SSML xml:lang attribute instead of just the language code (e.g., "en")
Additional Information
The other TTS code paths in the same file already use the full locale correctly
Tested by reviewing the code path and verifying the SSML output format matches Azure documentation requirements
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 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/22437
**Author:** [@alvinttang](https://github.com/alvinttang)
**Created:** 3/8/2026
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `fix/azure-tts-locale-truncation`
---
### 📝 Commits (1)
- [`b2ee9df`](https://github.com/open-webui/open-webui/commit/b2ee9df91b7493e72758b61d6b16863faf2f3e50) fix: correct Azure TTS locale extraction for SSML xml:lang
### 📊 Changes
**1 file changed** (+1 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/routers/audio.py` (+1 -1)
</details>
### 📄 Description
### Description
- Fixed incorrect locale extraction in Azure TTS SSML generation. `split("-")[:1]` only takes the first segment (e.g., "en" from "en-US"), producing an invalid SSML `xml:lang` attribute. Changed to `[:2]` to preserve the full locale (e.g., "en-US").
### Fixed
- Azure TTS now correctly uses the full locale (e.g., "en-US") in SSML `xml:lang` attribute instead of just the language code (e.g., "en")
### Additional Information
- The other TTS code paths in the same file already use the full locale correctly
- Tested by reviewing the code path and verifying the SSML output format matches Azure documentation requirements
- Self-reviewed the code changes
- Rebased onto dev (replaces #22432)
### Contributor License Agreement
- [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22437
Author: @alvinttang
Created: 3/8/2026
Status: ❌ Closed
Base:
dev← Head:fix/azure-tts-locale-truncation📝 Commits (1)
b2ee9dffix: correct Azure TTS locale extraction for SSML xml:lang📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
backend/open_webui/routers/audio.py(+1 -1)📄 Description
Description
split("-")[:1]only takes the first segment (e.g., "en" from "en-US"), producing an invalid SSMLxml:langattribute. Changed to[:2]to preserve the full locale (e.g., "en-US").Fixed
xml:langattribute instead of just the language code (e.g., "en")Additional Information
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.