remove watson (closes #37)
All checks were successful
mozhi pipeline / Push Docker image to Codeberg docker registry (push) Successful in 30m52s
mozhi pipeline / Build and publish artifacts (push) Successful in 1h31m31s

This commit is contained in:
Arya 2024-05-24 14:16:31 +05:30
parent c3415ae79e
commit 098bd9f577
Signed by: arya
GPG Key ID: 842D12BDA50DF120
6 changed files with 6 additions and 8 deletions

View File

@ -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`

View File

@ -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.")

View File

@ -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")

2
go.mod
View File

@ -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

2
go.sum
View File

@ -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=

View File

@ -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")
}