Update README

This commit is contained in:
Piero Toffanin 2020-12-20 16:13:38 -05:00
parent a11e6ee920
commit 3791a825ee

View file

@ -1,17 +1,43 @@
# LibreTranslate
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.
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.
![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)
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
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:
```bash
@ -21,6 +47,8 @@ pip install -r requirements.txt
python main.py [args]
```
Then open a web browser to http://localhost:5000
## Arguments
| Argument | Description | Default |