This crate permits to translate text between languages easily. Its goals are:
- implementing an unique library for different APIs
- permitting language translations / detections with or withtout API key when possible
- ease of use / relative performances
- (later) async translations
It wants to implement the following APIs:
[x]with API key
[ ]without key (5_000 chars/translation max)
[ ]Google Translate
To use it, you first need to construct a translator (a struct implementing the Api trait).
Then, you will be able to do various function calls on this struct:
my_translator.translate(my_text, input_language, target_language)
my_translator.detect(my_text)if the API implements language detection
For the moment, only the Yandex API is implemented.
To see examples on how to use it, see its documentation.
A module containing the implementation of the Yandex Translate API.
Yandex Translate API
Enum containing different errors that may be raised by the program at runtime.
Represents the languages that the text to translate shall use.
Represents all the languages available for translation.
A trait defining a translate API.
Used on enums representing errors that a call to an API returned.