mirror of
https://github.com/sr229/metastruct-experiments.git
synced 2024-09-20 06:30:36 +00:00
make language selection lowercase
Signed-off-by: Ayane Satomi <ayane@vignetteapp.org>
This commit is contained in:
parent
ff18e9e45f
commit
a500253033
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
--@client
|
--@client
|
||||||
|
|
||||||
local remoteLanguageIndex = "https://raw.githubusercontent.com/sr229/metastruct-experiments/master/starfall_metadata/allowed_google_voices.json"
|
local remoteLanguageIndex = "https://raw.githubusercontent.com/sr229/metastruct-experiments/master/starfall_metadata/allowed_google_voices.json"
|
||||||
|
local localLanguageIndex = "./tts_index.json"
|
||||||
local languageIndex = {}
|
local languageIndex = {}
|
||||||
local errorLookup = { [2] = "Invalid language" }
|
local errorLookup = { [2] = "Invalid language" }
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ hook.add("playerchat", "tts", function(ply, txt)
|
||||||
if #l > 1 then
|
if #l > 1 then
|
||||||
local lastLang = currentLang
|
local lastLang = currentLang
|
||||||
|
|
||||||
if hasval(languageIndex, l) then
|
if hasval(languageIndex, string.lower(l)) then
|
||||||
currentLang = l
|
currentLang = l
|
||||||
print("Language set to " .. l)
|
print("Language set to " .. l)
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue