Skip to content

Commit

Permalink
Fix Traduora reloads
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Mar 25, 2023
1 parent ceb7755 commit b8c90e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@Data
public class AddTranslationRequest {
@SerializedName("termId")
private final String termId;
@SerializedName("value")
private final String text;
private final String value;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import eu.mizerak.alemiz.translationlib.service.scrappers.TranslationDataScrapper;
import eu.mizerak.alemiz.translationlib.service.utils.Configuration;
import io.avaje.http.client.HttpClient;
import io.avaje.http.client.HttpClientResponse;
import io.avaje.http.client.HttpException;
import io.avaje.http.client.gson.GsonBodyAdapter;
import io.avaje.inject.PostConstruct;
Expand Down Expand Up @@ -118,11 +119,10 @@ public String addTerm(@NotNull TranslationTerm term, boolean replace) throws Htt
traduoraTerm = clientApi.addTerm(traduoraTerm, this.projectId);

String termId = traduoraTerm.getId();
// for (Map.Entry<Locale, String> entry : term.getTranslations().entrySet()) {
// String locale = entry.getKey().getLanguage() + "_" + entry.getKey().getCountry();
// TODO: updating is broken :(
// clientApi.updateTermTranslation(new AddTranslationRequest(termId, entry.getValue()), this.projectId, locale);
// }
for (Map.Entry<Locale, String> entry : term.getTranslations().entrySet()) {
String locale = entry.getKey().getLanguage() + "_" + entry.getKey().getCountry();
clientApi.updateTermTranslation(new AddTranslationRequest(termId, entry.getValue()), this.projectId, locale);
}
return termId;
}

Expand Down

0 comments on commit b8c90e4

Please sign in to comment.