[PR #22437] [CLOSED] fix: correct Azure TTS locale extraction for SSML xml:lang #65550

Closed
opened 2026-05-06 11:24:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22437
Author: @alvinttang
Created: 3/8/2026
Status: Closed

Base: devHead: fix/azure-tts-locale-truncation


📝 Commits (1)

  • 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
  • Self-reviewed the code changes
  • Rebased onto dev (replaces #22432)

Contributor License Agreement


🔄 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>
GiteaMirror added the pull-request label 2026-05-06 11:24:34 -05: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#65550