From eb2aaea6cb8685ebd22fd1ca04d442f7c4762dda Mon Sep 17 00:00:00 2001 From: JEleniel <49402984+JEleniel@users.noreply.github.com> Date: Sun, 6 Oct 2024 12:56:30 -0400 Subject: [PATCH] fix, i18n - sort the list of TTS voices and reformat the names returned by the built in speech syntehsis --- src/lib/components/admin/Settings/Audio.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/components/admin/Settings/Audio.svelte b/src/lib/components/admin/Settings/Audio.svelte index 040bc5e1a..63dd3d2e2 100644 --- a/src/lib/components/admin/Settings/Audio.svelte +++ b/src/lib/components/admin/Settings/Audio.svelte @@ -66,6 +66,7 @@ // do your loop if (voices.length > 0) { clearInterval(getVoicesLoop); + voices.sort((a,b) => a.name.localeCompare(b.name,$i18n.resolvedLanguage)); } }, 100); } else { @@ -76,6 +77,7 @@ if (res) { console.log(res); voices = res.voices; + voices.sort((a,b) => a.name.localeCompare(b.name,$i18n.resolvedLanguage)); } } }; @@ -295,7 +297,7 @@ {voice.name.replace('+',', ')} {/each}