Fix on-device transcription failing with non-default system region#57
Open
brianchiruka wants to merge 1 commit into
Open
Fix on-device transcription failing with non-default system region#57brianchiruka wants to merge 1 commit into
brianchiruka wants to merge 1 commit into
Conversation
…sion Locales like en-US-u-rg-zazzzz (English US language + South Africa region) are not recognised by Apple's Speech framework. Strip the -u-* extension before matching against supported locales so the base tag (e.g. en-US) is used for lookup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
TimLai666
added a commit
to TimLai666/fronda
that referenced
this pull request
Jun 23, 2026
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.
Summary
matchLocalewas callingcandidate.region?.identifierdirectly on the raw locale, so a locale likeen-US-u-rg-zazzzz(English US language + South Africa region) produced a garbled region and failed to match any supported Speech locale-u-*) from the BCP 47 identifier before matching, leaving a clean tag likeen-USthat the Speech framework recognisesRepro
System language: English (US), Region: South Africa → locale becomes
en-US-u-rg-zazzzz→ transcription fails with "On-device transcription is not available for en-US-u-rg-zazzzz"Test plan