Changeset 60 in code for trunk


Ignore:
Timestamp:
Jan 20, 2024, 11:01:02 PM (17 months ago)
Author:
yakumo.izuru
Message:

GET HTTP リクエストが機能しない問題を修正し、iCIBA および LibreTranslate エンジンを再追加し、マニュアル ページを作成し、Docker に関連するものを削除しました。

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

Location:
trunk
Files:
4 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/README.md

    r57 r60  
    3333
    3434### 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/).
     35Mai 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)
    3636
    37 Mai is not affiliated with Google Translate nor Reverso, which this program relays.
     37Mai is not affiliated with none of the above, which this program relays.
    3838
    3939Trademarks belong to their respective owners.
    40 Google Translate is a trademark of [Google LLC](https://www.google.com). Reverso is a trademark of Reverso.
     40Google Translate is a trademark of [Google LLC](https://www.google.com). Reverso is a trademark of Reverso, et cetera.
    4141
    4242The 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  
    3939        })
    4040
    41         api := app.Group("/api")
    42 
    4341        app.All("/", func(c *fiber.Ctx) error {
    4442                engine := c.Cookies("engine")
     
    140138        })
    141139
    142         api.All("/api/translate", func(c *fiber.Ctx) error {
     140        app.All("/api/translate", func(c *fiber.Ctx) error {
    143141                from := ""
    144142                to := ""
     
    171169        })
    172170
    173         api.Get("/api/source_languages", func(c *fiber.Ctx) error {
     171        app.Get("/api/source_languages", func(c *fiber.Ctx) error {
    174172                engine := c.Query("engine")
    175173                if _, ok := engines.Engines[engine]; !ok || engine == "" {
     
    183181        })
    184182
    185         api.Get("/api/target_languages", func(c *fiber.Ctx) error {
     183        app.Get("/api/target_languages", func(c *fiber.Ctx) error {
    186184                engine := c.Query("engine")
    187185                if _, ok := engines.Engines[engine]; !ok || engine == "" {
     
    195193        })
    196194
    197         api.Get("/api/tts", func(c *fiber.Ctx) error {
     195        app.Get("/api/tts", func(c *fiber.Ctx) error {
    198196                engine := c.Query("engine")
    199197                if _, ok := engines.Engines[engine]; !ok || engine == "" {
     
    222220                }
    223221        })
    224         api.Get("/version", func(c *fiber.Ctx) error {
     222        app.Get("/version", func(c *fiber.Ctx) error {
    225223                return c.JSON(fiber.Map{
    226224                        "fiberversion": fiber.Version,
  • trunk/engines/engine.go

    r53 r60  
    11package engines
     2
     3import (
     4        "os"
     5)
    26
    37type TranslationResult struct {
     
    2125        "google": &GoogleTranslate{},
    2226        "reverso": &Reverso{},
     27        "iciba": &ICIBA{},
     28        "libretranslate": &LibreTranslate{
     29                InstanceURL: os.Getenv("MAI_LIBRETRANSLATE_INSTANCE"),
     30                APIKey: os.Getenv("MAI_LIBRETRANSLATE_API"),
     31        },
    2332}
Note: See TracChangeset for help on using the changeset viewer.