TranslationService class
Enhanced translation service with retry logic, rate limiting, and comprehensive error handling.
This class provides robust translation capabilities using multiple translation APIs with intelligent fallback mechanisms and rate limiting to prevent API abuse.
Constructors
- TranslationService(TranslatorConfig _config)
-
Creates a TranslationService with the given
config
.
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
-
dispose(
) → void - Disposes of the HTTP client resources.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
translateBatch(
Map< String, String> translations, String targetLang, {String? sourceLang}) → Future<Map< String, String> > - Translates multiple texts concurrently with proper throttling.
-
translateText(
String text, String targetLang, {String? sourceLang}) → Future< String> -
Translates the given
text
into the specifiedtargetLang
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited