Implemented Definitions and Translations in Web interface

git-svn-id: file:///srv/svn/repo/mai/trunk@22 e410bdd4-646f-c54f-a7ce-fffcc4f439ae
This commit is contained in:
manerakai
2023-08-31 12:56:47 +00:00
parent 0b826f2255
commit 79983d9e7e
3 changed files with 143 additions and 85 deletions

View File

@@ -39,6 +39,7 @@ func main() {
ttsFrom := ""
ttsTo := ""
var translation engines.TranslationResult
if c.Method() == "POST" {
from = c.FormValue("from")
to = c.FormValue("to")
@@ -47,6 +48,7 @@ func main() {
return c.SendStatus(500)
} else {
translatedText = result.TranslatedText
translation = result
}
ttsFromURL, _ := url.Parse("api/tts")
@@ -93,7 +95,7 @@ func main() {
"SourceLanguages": sourceLanguages,
"TargetLanguages": targetLanguages,
"OriginalText": originalText,
"TranslatedText": translatedText,
"Translation": translation,
"From": from,
"To": to,
"TtsFrom": ttsFrom,