Changeset 60 in code
- Timestamp:
- Jan 20, 2024, 11:01:02 PM (17 months ago)
- Location:
- trunk
- Files:
-
- 4 added
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/README.md
r57 r60 33 33 34 34 ### Legal notice 35 Mai does not host any content. All content shown on any Mai /Mozhi/SimplyTranslate instances is from [Google Translate](https://translate.google.com) and [Reverso](https://www.reverso.net/).35 Mai does not host any content. All content shown on any Mai instances is from [Google Translate](https://translate.google.com), [Reverso](https://www.reverso.net/), [iCIBA](https://www.iciba.net) and [LibreTranslate](https://libretranslate.com) 36 36 37 Mai is not affiliated with Google Translate nor Reverso, which this program relays.37 Mai is not affiliated with none of the above, which this program relays. 38 38 39 39 Trademarks belong to their respective owners. 40 Google Translate is a trademark of [Google LLC](https://www.google.com). Reverso is a trademark of Reverso .40 Google Translate is a trademark of [Google LLC](https://www.google.com). Reverso is a trademark of Reverso, et cetera. 41 41 42 42 The creators and maintainers of this repository assume no liability for the accuracy and timeliness of any information provided above. Trademark owner information was researched to the best of the author's knowledge at the time of curation and may be outdated or incorrect. -
trunk/cmd/mai/main.go
r59 r60 39 39 }) 40 40 41 api := app.Group("/api")42 43 41 app.All("/", func(c *fiber.Ctx) error { 44 42 engine := c.Cookies("engine") … … 140 138 }) 141 139 142 ap i.All("/api/translate", func(c *fiber.Ctx) error {140 app.All("/api/translate", func(c *fiber.Ctx) error { 143 141 from := "" 144 142 to := "" … … 171 169 }) 172 170 173 ap i.Get("/api/source_languages", func(c *fiber.Ctx) error {171 app.Get("/api/source_languages", func(c *fiber.Ctx) error { 174 172 engine := c.Query("engine") 175 173 if _, ok := engines.Engines[engine]; !ok || engine == "" { … … 183 181 }) 184 182 185 ap i.Get("/api/target_languages", func(c *fiber.Ctx) error {183 app.Get("/api/target_languages", func(c *fiber.Ctx) error { 186 184 engine := c.Query("engine") 187 185 if _, ok := engines.Engines[engine]; !ok || engine == "" { … … 195 193 }) 196 194 197 ap i.Get("/api/tts", func(c *fiber.Ctx) error {195 app.Get("/api/tts", func(c *fiber.Ctx) error { 198 196 engine := c.Query("engine") 199 197 if _, ok := engines.Engines[engine]; !ok || engine == "" { … … 222 220 } 223 221 }) 224 ap i.Get("/version", func(c *fiber.Ctx) error {222 app.Get("/version", func(c *fiber.Ctx) error { 225 223 return c.JSON(fiber.Map{ 226 224 "fiberversion": fiber.Version, -
trunk/engines/engine.go
r53 r60 1 1 package engines 2 3 import ( 4 "os" 5 ) 2 6 3 7 type TranslationResult struct { … … 21 25 "google": &GoogleTranslate{}, 22 26 "reverso": &Reverso{}, 27 "iciba": &ICIBA{}, 28 "libretranslate": &LibreTranslate{ 29 InstanceURL: os.Getenv("MAI_LIBRETRANSLATE_INSTANCE"), 30 APIKey: os.Getenv("MAI_LIBRETRANSLATE_API"), 31 }, 23 32 }
Note:
See TracChangeset
for help on using the changeset viewer.