diff --git a/service/src/main/java/eu/mizerak/alemiz/translationlib/service/scrappers/traduora/AddTranslationRequest.java b/service/src/main/java/eu/mizerak/alemiz/translationlib/service/scrappers/traduora/AddTranslationRequest.java index 0ccf922..5713cf5 100644 --- a/service/src/main/java/eu/mizerak/alemiz/translationlib/service/scrappers/traduora/AddTranslationRequest.java +++ b/service/src/main/java/eu/mizerak/alemiz/translationlib/service/scrappers/traduora/AddTranslationRequest.java @@ -5,7 +5,7 @@ @Data public class AddTranslationRequest { + @SerializedName("termId") private final String termId; - @SerializedName("value") - private final String text; + private final String value; } diff --git a/service/src/main/java/eu/mizerak/alemiz/translationlib/service/scrappers/traduora/TraduoraScrapper.java b/service/src/main/java/eu/mizerak/alemiz/translationlib/service/scrappers/traduora/TraduoraScrapper.java index 365b653..da7111d 100644 --- a/service/src/main/java/eu/mizerak/alemiz/translationlib/service/scrappers/traduora/TraduoraScrapper.java +++ b/service/src/main/java/eu/mizerak/alemiz/translationlib/service/scrappers/traduora/TraduoraScrapper.java @@ -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; @@ -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 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 entry : term.getTranslations().entrySet()) { + String locale = entry.getKey().getLanguage() + "_" + entry.getKey().getCountry(); + clientApi.updateTermTranslation(new AddTranslationRequest(termId, entry.getValue()), this.projectId, locale); + } return termId; }