~metalune/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] simplytranslate_web: Added documentation for api

Details
Message ID
<PR3P191MB1129A9E9F3B3967E5053D7B5DF839@PR3P191MB1129.EURP191.PROD.OUTLOOK.COM>
DKIM signature
pass
Download raw message
Patch: +70 -2
From: ManeraKai <manerakai@protonmail.com>

---
 README.md   |  7 ++++--
 api.md      | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 config.conf |  3 +++
 3 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100644 api.md

diff --git a/README.md b/README.md
index 4243bf9..66e703e 100644
--- a/README.md
+++ b/README.md
@@ -38,9 +38,12 @@ python3 main.py
uvicorn main:app --port 5000
```

## API
[Documentation](./api.md)

## Other projects like this
[gtranslate](https://git.sr.ht/~yerinalexey/gtranslate)
[lingva translate](https://github.com/TheDavidDelta/lingva-translate)
* [gtranslate](https://git.sr.ht/~yerinalexey/gtranslate)
* [lingva translate](https://github.com/TheDavidDelta/lingva-translate)

## Contact

diff --git a/api.md b/api.md
new file mode 100644
index 0000000..0087e59
--- /dev/null
+++ b/api.md
@@ -0,0 +1,62 @@
# SimplyTranslate Web API
## How to access the API
By going to the path `/api/`.\
Ex: https://simplytranslate.org/api/.

## Translate
Path `/api/translate/`
#### Arguments
* `engine`
    * `google`

        Google Translate
    * `libre`

        Libre Translate

* `from`

    Choose the From-Language (Source Language). It's based on the engine.
* `to`

    Choose the To-Language (Target Language). It's based on the engine.

* `text`

    The original text (input).

Ex: https://simplytranslate.org/api/translate/?engine=google&from=en&to=es&text=Hello.

## Get Languages
Path `/api/get_languages/`
#### Arguments
* `engine`
    * `google`

        Google Translate
    * `libre`

        Libre Translate

Ex: https://simplytranslate.org/api/get_languages/?engine=google.

## Text-To-Speech (TTS)
Path `/api/tts/`
#### Arguments
* `engine`
    * `google`

        Google Translate
    * `libre`

        Libre Translate

* `lang`

    Choose the language. It's based on the engine.

* `text`

    Input.

Ex: https://simplytranslate.org/api/tts/?engine=google&lang=en&text=Hello.
\ No newline at end of file
diff --git a/config.conf b/config.conf
index 508a302..383f505 100644
--- a/config.conf
+++ b/config.conf
@@ -15,6 +15,9 @@ ApiKey = [REDACTED]
# Google translate is enabled by default.
Enabled = True

[deepl]
Enabled = True

[network]
port = 5000
host = 0.0.0.0
\ No newline at end of file
-- 
2.25.1
Details
Message ID
<CF8R242A0PHW.26R2LTEW366PS@thinkpad>
In-Reply-To
<PR3P191MB1129A9E9F3B3967E5053D7B5DF839@PR3P191MB1129.EURP191.PROD.OUTLOOK.COM> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Merged.
Reply to thread Export thread (mbox)