diff --git a/README.md b/README.md index dd78601..7c3b874 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ I'm initially focusing on the api and engines, but eventually Mozhi will have a - DeepL - LibreTranslate - Yandex -- IBM Watson - MyMemory - DuckDuckGo (almost 1-1 with Bing Translate) @@ -62,7 +61,6 @@ These envvars turn off/on engines. By default all of them are enabled. - `MOZHI_DEEPL_ENABLED` - `MOZHI_LIBRETRANSLATE_ENABLED` - `MOZHI_YANDEX_ENABLED` -- `MOZHI_WATSON_ENABLED` - `MOZHI_MYMEMORY_ENABLED` - `MOZHI_DUCKDUCKGO_ENABLED` diff --git a/cmd/langlist.go b/cmd/langlist.go index 5a00123..69d8895 100644 --- a/cmd/langlist.go +++ b/cmd/langlist.go @@ -47,7 +47,7 @@ func init() { rootCmd.AddCommand(langlistCmd) translateCmd.Flags().SortFlags = false - langlistCmd.Flags().StringVarP(&engineused, "engine", "e", "", "[google|libre|reverso|deepl|watson|yandex|mymemory|duckduckgo]") + langlistCmd.Flags().StringVarP(&engineused, "engine", "e", "", "[google|libre|reverso|deepl|yandex|mymemory|duckduckgo]") langlistCmd.Flags().StringVarP(&listtype, "type", "t", "", "[sl|tl] Choose language for source or target") langlistCmd.Flags().BoolVarP(&raw, "raw", "r", false, "Return only selected language code.") diff --git a/cmd/translate.go b/cmd/translate.go index 0b0f3d9..8dce38b 100644 --- a/cmd/translate.go +++ b/cmd/translate.go @@ -76,7 +76,7 @@ func init() { rootCmd.AddCommand(translateCmd) translateCmd.Flags().SortFlags = false - translateCmd.Flags().StringVarP(&engine, "engine", "e", "", "[all|google|libre|reverso|deepl|watson|yandex|mymemory|duckduckgo]") + translateCmd.Flags().StringVarP(&engine, "engine", "e", "", "[all|google|libre|reverso|deepl|yandex|mymemory|duckduckgo]") translateCmd.Flags().StringVarP(&source, "source", "s", "", "Source language. Use langlist command to get code for your language") translateCmd.Flags().StringVarP(&dest, "dest", "t", "", "Target language. Use langlist command to get code for your language") translateCmd.Flags().StringVarP(&query, "query", "q", "", "Text to be translated") diff --git a/go.mod b/go.mod index 8997ee2..79c31a6 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ replace github.com/OwO-Network/gdeeplx => github.com/gi-yt/gdeeplx v0.0.0-202308 //replace codeberg.org/aryak/libmozhi => /home/arya/projects/mozhi/libmozhi require ( - codeberg.org/aryak/libmozhi v0.0.0-20240523071337-8b01c19082f6 + codeberg.org/aryak/libmozhi v0.0.0-20240524084116-a931c9472e76 github.com/gofiber/fiber/v2 v2.52.4 github.com/gofiber/swagger v1.0.0 github.com/gofiber/template v1.8.0 diff --git a/go.sum b/go.sum index 3f8d2e9..3d73b15 100644 --- a/go.sum +++ b/go.sum @@ -51,6 +51,8 @@ codeberg.org/aryak/libmozhi v0.0.0-20240522120450-090c25dcb721 h1:ZQ/tqILWJvFRZz codeberg.org/aryak/libmozhi v0.0.0-20240522120450-090c25dcb721/go.mod h1:X3kF1lzpbtHzJZUpPgNl9eJG70fskeqjuJYVHz+uNSo= codeberg.org/aryak/libmozhi v0.0.0-20240523071337-8b01c19082f6 h1:f7BFWPme7xHpFoUGudq2moIQ0BwNkCRyMyyZrUOyrJo= codeberg.org/aryak/libmozhi v0.0.0-20240523071337-8b01c19082f6/go.mod h1:cLOtjCmU2AsoL1B+kOzjOMWXYcsdewK8A5s5d/lQVBM= +codeberg.org/aryak/libmozhi v0.0.0-20240524084116-a931c9472e76 h1:GsOycW30JTgEz4h4bnGGAm668g3Ir+LCQPsbcJ2hgjo= +codeberg.org/aryak/libmozhi v0.0.0-20240524084116-a931c9472e76/go.mod h1:cLOtjCmU2AsoL1B+kOzjOMWXYcsdewK8A5s5d/lQVBM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= diff --git a/utils/main.go b/utils/main.go index 5e7594c..03216cd 100644 --- a/utils/main.go +++ b/utils/main.go @@ -34,7 +34,7 @@ func Sanitize(str string, strip string) string { } func EngineList() map[string]string { - engines := map[string]string{"all": "All Engines", "google": "Google", "deepl": "DeepL", "duckduckgo": "DuckDuckGo", "libre": "LibreTranslate", "mymemory": "MyMemory", "reverso": "Reverso", "watson": "Watson", "yandex": "Yandex"} + engines := map[string]string{"all": "All Engines", "google": "Google", "deepl": "DeepL", "duckduckgo": "DuckDuckGo", "libre": "LibreTranslate", "mymemory": "MyMemory", "reverso": "Reverso", "yandex": "Yandex"} if EnvTrueNoExist("MOZHI_GOOGLE_ENABLED") == false { delete(engines, "google") } else if EnvTrueNoExist("MOZHI_DEEPL_ENABLED") == false { @@ -47,8 +47,6 @@ func EngineList() map[string]string { delete(engines, "mymemory") } else if EnvTrueNoExist("MOZHI_REVERSO_ENABLED") == false { delete(engines, "reverso") - } else if EnvTrueNoExist("MOZHI_WATSON_ENABLED") == false { - delete(engines, "watson") } else if EnvTrueNoExist("MOZHI_YANDEX_ENABLED") == false { delete(engines, "yandex") }