azure_translation
library
Enums
-
LanguageScope
-
Possible scopes for the language list request.
-
ScriptDirection
-
The direction that a script is written in, either ltr (left-to-right) or
rtl (right-to-left).
Functions
-
breakSentence(List<String> text, {String? language, String? script, required String key, required String region})
→ Future<Result<List<BrokenSentence>, AzureTranslationError>>
-
-
detect(List<String> text, {required String key, required String region})
→ Future<Result<List<DetectionResult>, AzureTranslationError>>
-
-
languages({String? baseLanguage, Iterable<LanguageScope>? scopes})
→ Future<Result<LanguageList, AzureTranslationError>>
-
Returns a list of supported languages for translation, transliteration, and
dictionary lookup.
scopes
can be omitted, in which case all three scopes will be returned.
baseLanguage
can optionally be provided, and the names of returned
languages will be translated into it.
-
translate(List<String> text, {required String key, required String region, String? baseLanguage, required List<String> languages})
→ Future<Result<List<TranslationResult>, AzureTranslationError>>
-
Translates a list of
text
to one or more languages
.
key
and region
must be provided.
baseLanguage
is an optional base language code, e.g. 'en' or 'fr'. If omitted,
it will be detected and each result will include a DetectedLanguage.
-
transliterate(List<String> text, {required String key, required String region, required String language, required String fromScript, required String toScript})
→ Future<Result<TransliterationResult, AzureTranslationError>>
-
Transliterates a list of
text
in language
from fromScript
to toScript
.
key
and region
must be provided.