mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-21 23:41:01 +00:00
Update README
This commit is contained in:
parent
a11e6ee920
commit
3791a825ee
1 changed files with 32 additions and 4 deletions
36
README.md
36
README.md
|
@ -1,17 +1,43 @@
|
||||||
# LibreTranslate
|
# LibreTranslate
|
||||||
|
|
||||||
Free and Open Source Translation API.
|
Free and Open Source Translation API, entirely self-hosted and can work in offline environments. Unlike other APIs, it doesn't rely on proprietary providers such as Google or Azure to perform translations.
|
||||||
|
|
||||||
Entirely self-hosted and can work in offline environments. Unlike other APIs, it doesn't rely on proprietary providers such as Google or Azure to perform translations.
|
|
||||||
|
|
||||||
![image](https://user-images.githubusercontent.com/1951843/102724116-32a6df00-42db-11eb-8cc0-129ab39cdfb5.png)
|
![image](https://user-images.githubusercontent.com/1951843/102724116-32a6df00-42db-11eb-8cc0-129ab39cdfb5.png)
|
||||||
|
|
||||||
[Try it online!](https://libretranslate.com) | [API Docs](https://libretranslate.com/docs)
|
[Try it online!](https://libretranslate.com) | [API Docs](https://libretranslate.com/docs)
|
||||||
|
|
||||||
Website: [libretranslate.com](https://libretranslate.com)
|
## API Examples
|
||||||
|
|
||||||
|
Request:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const res = await fetch("https://libretranslate.com/translate", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
q: "Hello!",
|
||||||
|
source: "en",
|
||||||
|
target: "es"
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(await res.json());
|
||||||
|
```
|
||||||
|
|
||||||
|
Response:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
{
|
||||||
|
"translatedText": "¡Hola!"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Build and Run
|
## Build and Run
|
||||||
|
|
||||||
|
You can run your own API server in just a few lines of setup!
|
||||||
|
|
||||||
Make sure you have installed Python (3.8 or higher), then simply issue:
|
Make sure you have installed Python (3.8 or higher), then simply issue:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -21,6 +47,8 @@ pip install -r requirements.txt
|
||||||
python main.py [args]
|
python main.py [args]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Then open a web browser to http://localhost:5000
|
||||||
|
|
||||||
## Arguments
|
## Arguments
|
||||||
|
|
||||||
| Argument | Description | Default |
|
| Argument | Description | Default |
|
||||||
|
|
Loading…
Reference in a new issue