Ver código fonte

fix, i18n - sort the list of TTS voices and reformat the names returned by the built in speech syntehsis

JEleniel 7 meses atrás
pai
commit
eb2aaea6cb
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      src/lib/components/admin/Settings/Audio.svelte

+ 3 - 1
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 @@
 										<option
 											value={voice.voiceURI}
 											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}
 								</select>