refactor: Update translator.ts to include auto language detection

This commit is contained in:
Junha Heo
2024-08-24 17:57:34 +09:00
parent 14fb2267c3
commit c14503625f

View File

@@ -165,7 +165,7 @@ async function translateMain(text:string, arg:{from:string, to:string, host:stri
}
const url = `https://${arg.host}/translate_a/single?client=gtx&dt=t&sl=${arg.from}&tl=${arg.to}&q=` + encodeURIComponent(text)
const url = `https://${arg.host}/translate_a/single?client=gtx&dt=t&sl=auto&tl=${arg.to}&q=` + encodeURIComponent(text)