LibreTranslate | Open Source Machine Translation API | Translation library
kandi X-RAY | LibreTranslate Summary
kandi X-RAY | LibreTranslate Summary
Try it online! | API Docs | Community Forum. Free and Open Source Machine Translation API, entirely self-hosted. Unlike other APIs, it doesn't rely on proprietary providers such as Google or Azure to perform translations. Instead, its translation engine is powered by the open source Argos Translate library. Try it online! | API Docs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create a Flask app .
- Parse arguments .
- Detect languages of text .
- Check if available language models from remote .
- Manage manage tools
- Install and install transliteration .
- Transliterate a line of text .
- Return the limit for the given API key .
- Main entry point .
- get routes limits
LibreTranslate Key Features
LibreTranslate Examples and Code Snippets
use libretranslate::{translate, Language};
#[tokio::main]
async fn main() {
let source = Language::French;
let target = Language::English;
let input = "Le texte français.";
let data = translate(source, target, input, None).await.unw
use libretranslate::{Language, Translate};
#[tokio::main]
async fn main() {
let text = "This is text, written on a computer, in English."
.to_lang(Language::German)
.from_lang(Language::English)
.translate()
.awai
use libretranslate::{translate, Language};
#[tokio::main]
async fn main() {
let source = Language::French;
let target = Language::English;
let input = "Le texte français.";
let data = translate(Some(source), target, input).await.unw
Community Discussions
Trending Discussions on LibreTranslate
QUESTION
I have the following Struct that I want to initialize, and then use its method query() to mutate its result property.
Query() sends and fetches JSON data, then decodes it to a String. When I declare query() as a mutating function, I receive the error "Escaping closure captures mutating 'self' parameter" in my URLSession.
What do I need to change?
The call:
...ANSWER
Answered 2021-Apr-03 at 15:07There are many issues in the code.
The most significant issue is that the URLRequest
is asynchronous. Even if no error occurred result
will be always empty.
You have to add a completion handler – it fixes the errors you got by the way – and it's highly recommended to handle all errors.
Instead of JSONSerialization
the code uses JSONDe/Encoder
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install LibreTranslate
If you want to make some changes to the code, you can build from source, and run the API:. Then open a web browser to http://localhost:5000.
If you want to run the Docker image in a complete offline environment, you need to add the --build-arg with_models=true parameter. Then the language models get downloaded during the build process of the image. Otherwise these models get downloaded on the first run of the image/container.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page