mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
Merge pull request #5940 from JEleniel/voice_i18n_sort
fix: sort the list of TTS voices and reformat the names
This commit is contained in:
commit
9ef3fb0bc7
@ -66,6 +66,7 @@
|
|||||||
// do your loop
|
// do your loop
|
||||||
if (voices.length > 0) {
|
if (voices.length > 0) {
|
||||||
clearInterval(getVoicesLoop);
|
clearInterval(getVoicesLoop);
|
||||||
|
voices.sort((a,b) => a.name.localeCompare(b.name,$i18n.resolvedLanguage));
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
} else {
|
} else {
|
||||||
@ -76,6 +77,7 @@
|
|||||||
if (res) {
|
if (res) {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
voices = res.voices;
|
voices = res.voices;
|
||||||
|
voices.sort((a,b) => a.name.localeCompare(b.name,$i18n.resolvedLanguage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -295,7 +297,7 @@
|
|||||||
<option
|
<option
|
||||||
value={voice.voiceURI}
|
value={voice.voiceURI}
|
||||||
class="bg-gray-100 dark:bg-gray-700"
|
class="bg-gray-100 dark:bg-gray-700"
|
||||||
selected={TTS_VOICE === voice.voiceURI}>{voice.name}</option
|
selected={TTS_VOICE === voice.voiceURI}>{voice.name.replace('+',', ')}</option
|
||||||
>
|
>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
Reference in New Issue
Block a user