diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +* diff --git a/go.mod b/go.mod index f2c285a..b15b7db 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,3 @@ module git.kyoko-project.wer.ee/koizumi.aoi/stcli-go go 1.18 - -require github.com/astaxie/bat v0.0.2 diff --git a/go.sum b/go.sum index 05acb3f..e69de29 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +0,0 @@ -github.com/astaxie/bat v0.0.2 h1:EOl52CfuFEnFqu9/mzex93mh7JWdtEGbGQlpih00GWQ= -github.com/astaxie/bat v0.0.2/go.mod h1:poAI7wDJd5LpfwfBXsGWYIqmVO66dhBx31zhn0ZXdMI= diff --git a/main.go b/main.go index 9c744bb..48dbc2b 100644 --- a/main.go +++ b/main.go @@ -1,4 +1,4 @@ -// $KyokoNet: stcli-go,v 1.1 2022/12/13 10:07:00 akoizumi Exp +// $KyokoNet: stcli-go,v 1.2 2022/12/13 22:13:00 akoizumi Exp // Command line client for SimplyTranslate, a privacy friendly frontend to Google Translate package main @@ -9,6 +9,7 @@ import ( "io" "log" "net/http" + "net/url" "os" ) var ( @@ -40,7 +41,8 @@ func main() { // Map a variable to the struct var translate Translate // Build the full URL to query - var queryURL = instance + "?engine=" + engine + "&from=" + from + "&to=" + to + "&text=" + input + var encinput = url.PathEscape(input) + var queryURL = instance + "?engine=" + engine + "&from=" + from + "&to=" + to + "&text=" + encinput // Begin the request and process the response req, err := http.Get(queryURL) sanityCheck(err) diff --git a/stcli-go.1 b/stcli-go.1 index 32bb33e..9843af1 100644 --- a/stcli-go.1 +++ b/stcli-go.1 @@ -1,4 +1,4 @@ -.Dd Aftermath 56, 3188 +.Dd Aftermath 57, 3188 .Dt STCLI-GO 1 .Os .Sh NAME @@ -38,5 +38,4 @@ Target language to translate to .Pp .An Baobab Aq Mt baobab@honeypot.im .Sh BUGS -This utility cannot translate strings -separated by spaces. +None so far