Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need to get service ID before calling the translation for error logging #64

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ public TranslationResponse translate(TranslationRequest translationRequest)
String serviceId = null;
for (TranslationService cachedTranslationService : cachedTranslationServices) {
try {
serviceId = cachedTranslationService.getServiceId();
// send the values which are not yet translated (isTranslated=false) for the translations
cachedTranslationService.translate(translObjs.stream().filter(to -> !to.isTranslated()).collect(Collectors.toList()));
// call this method after the translate() method, because the serviceId changes depending if
// there is sth in the cache
// update service ID after the translate() method, because the serviceId may change (depending if there is sth in the cache)
//NOTE: is this really needed?
serviceId = cachedTranslationService.getServiceId();
// clear translation error if the invocation is successfull
translationError = null;
Expand Down
Loading