go mod tidy + gofmt
This commit is contained in:
@@ -21,7 +21,6 @@ func HandleSourceLanguages(c *fiber.Ctx) error {
|
||||
data = utils.LangListDeepl("sl")
|
||||
} else if engine == "watson" {
|
||||
data = utils.LangListWatson("sl")
|
||||
}
|
||||
} else if engine == "yandex" {
|
||||
data = utils.LangListYandex("sl")
|
||||
}
|
||||
@@ -43,7 +42,6 @@ func HandleTargetLanguages(c *fiber.Ctx) error {
|
||||
data = utils.LangListDeepl("tl")
|
||||
} else if engine == "watson" {
|
||||
data = utils.LangListWatson("tl")
|
||||
}
|
||||
} else if engine == "yandex" {
|
||||
data = utils.LangListYandex("tl")
|
||||
}
|
||||
@@ -52,7 +50,7 @@ func HandleTargetLanguages(c *fiber.Ctx) error {
|
||||
func HandleTTS(c *fiber.Ctx) error {
|
||||
engine := c.Query("engine")
|
||||
lang := c.Query("lang")
|
||||
text := c.Query("text")
|
||||
text := c.Query("text")
|
||||
// Why does go not have an andor statement :(
|
||||
if engine == "" {
|
||||
return c.SendStatus(fiber.StatusBadRequest)
|
||||
@@ -67,6 +65,6 @@ func HandleTTS(c *fiber.Ctx) error {
|
||||
} else if engine == "reverso" {
|
||||
data = utils.TTSReverso(lang, text)
|
||||
}
|
||||
c.Set("Content-Type", "audio/mpeg")
|
||||
c.Set("Content-Type", "audio/mpeg")
|
||||
return c.Send([]byte(data))
|
||||
}
|
||||
|
||||
@@ -1,20 +1,27 @@
|
||||
package pages
|
||||
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"codeberg.org/aryak/simplytranslate/utils"
|
||||
"fmt"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func HandleIndex(c *fiber.Ctx) error {
|
||||
// Check if all required queries are present
|
||||
m := c.Queries()
|
||||
sl, _ := m["sl"]
|
||||
tl, _ := m["tl"]
|
||||
engine, _ := m["engine"]
|
||||
text, _ := m["text"]
|
||||
if sl != "" && tl != "" && engine != "" && text != "" {
|
||||
fmt.Println("Work")
|
||||
}
|
||||
|
||||
return c.Render("index", fiber.Map{
|
||||
"host": c.Hostname(),
|
||||
"branch": utils.Branch,
|
||||
"version": utils.Version(),
|
||||
"fiberversion": fiber.Version,
|
||||
"goversion": runtime.Version(),
|
||||
"setupstatus": os.Getenv("SIMPLYTRANSLATE_SETUP_COMPLETE"),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user