update deps, make engine code into a lib
All checks were successful
mozhi pipeline / Push Docker image to Codeberg docker registry (push) Successful in 3m54s
mozhi pipeline / Build and publish artifacts (push) Successful in 13m27s

This commit is contained in:
2023-09-09 20:03:14 +05:30
parent 662192ab41
commit 566eb69743
28 changed files with 91 additions and 3537 deletions

View File

@@ -3,7 +3,7 @@ package cmd
import (
"fmt"
"codeberg.org/aryak/mozhi/utils"
libmozhi "codeberg.org/aryak/libmozhi"
"github.com/ktr0731/go-fuzzyfinder"
"github.com/spf13/cobra"
@@ -20,7 +20,7 @@ var langlistCmd = &cobra.Command{
Use: "langlist",
Short: "List/select languages supported by an engine.",
Run: func(cmd *cobra.Command, args []string) {
list, err := utils.LangList(engineused, listtype)
list, err := libmozhi.LangList(engineused, listtype)
if err != nil {
fmt.Println(err)
} else {

View File

@@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"
"codeberg.org/aryak/mozhi/utils"
libmozhi "codeberg.org/aryak/libmozhi"
"github.com/spf13/cobra"
)
@@ -22,7 +22,7 @@ var translateCmd = &cobra.Command{
Short: "Translate.",
Run: func(cmd *cobra.Command, args []string) {
if engine == "all" {
data := utils.TranslateAll(dest, source, query)
data := libmozhi.TranslateAll(dest, source, query)
if rawjson {
j, err := json.Marshal(data)
if err != nil {
@@ -44,7 +44,7 @@ var translateCmd = &cobra.Command{
fmt.Println("-----------------------------------")
}
} else {
data, err := utils.Translate(engine, dest, source, query)
data, err := libmozhi.Translate(engine, dest, source, query)
if rawjson {
j, err := json.Marshal(data)
if err != nil {