c72afe269a
The voice panel filtered voices by the full locale of the currently speaking text (v.lang.startsWith(locale)), so a book mixing region variants of one language flip-flopped its voice list: Standard Ebooks tag their boilerplate front matter en-US (17 Edge voices) while the body text is en-GB (5 Edge voices). Filter by primary language instead (isSameLang) in all three TTS clients so every English variant yields the same voice set, and sort voices matching the requested locale first (TTSUtils.sortVoicesPreferLocaleFunc) so default-voice resolution via getVoiceIdFromLang still picks an exact-locale voice. This also fixes languages whose tags never matched a voice locale prefix at all (e.g. zh-Hans books previously got an empty Edge voice list). Co-authored-by: Claude Fable 5 <noreply@anthropic.com>