make language selection lowercase

Signed-off-by: Ayane Satomi <ayane@vignetteapp.org>
This commit is contained in:
Ayane Satomi 2022-07-05 08:15:45 +08:00
parent ff18e9e45f
commit a500253033
No known key found for this signature in database
GPG key ID: 431E3C36BEBE204B

View file

@ -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