translateData method
Implementation
Future<Map<String, String>> translateData(Map<String, String> data,
{String? sourceLanguageCode,
String? targetLanguageCode,
List<String>? ignoreWords}) async {
if (data.isEmpty) {
throw "Input data should not be empty";
}
final source = _getSourceLanguage(sourceLanguageCode);
final target = _getTargetLanguage(targetLanguageCode);
final ignore = ignoreWords ?? [];
final result = await _httpClient.performDataTranslationRequest(
data, source, target, ignore);
// store in cache
_repository.storeData(result, source, target);
return result;
}