TranslationService class

Service for text translation

Constructors

TranslationService(HasabApiClient _client)
Create a new Translation service

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

detectLanguage(String text) Future<HasabLanguage>
Detect the language of a text
getSupportedLanguagePairs() Future<Map<HasabLanguage, List<HasabLanguage>>>
Get supported language pairs for translation
getTranslationHistory({int page = 1}) Future<Map<String, dynamic>>
Get translation history
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
translate(String text, HasabLanguage fromLanguage, HasabLanguage toLanguage, {Map<String, dynamic>? options}) Future<TranslationResponse>
Translate text from one language to another
translateBatch(List<String> texts, HasabLanguage fromLanguage, HasabLanguage toLanguage, {Map<String, dynamic>? options}) Future<List<TranslationResponse>>
Translate multiple texts in a batch
translateWithAutoDetect(String text, HasabLanguage toLanguage, {Map<String, dynamic>? options}) Future<TranslationResponse>
Auto-detect source language and translate to target language

Operators

operator ==(Object other) bool
The equality operator.
inherited