transResource.putTranslations("my.txt", de_DE, entity, null);
assertThat(putResponse.getResponseStatus(), is(Status.OK));
// Get the translations with PO headers
ClientResponse<TranslationsResource> response =
transResource.getTranslations("my.txt", de_DE, new StringSet(
"gettext"));
TranslationsResource translations = response.getEntity();
assertThat(translations.getTextFlowTargets().size(), greaterThan(0));
// Now translate and push them again
for (TextFlowTarget tft : translations.getTextFlowTargets()) {
tft.setContents("Translated");
tft.setState(ContentState.Approved);
}
putResponse =
transResource.putTranslations("my.txt", de_DE, translations,
null);
assertThat(putResponse.getStatus(),
is(Response.Status.OK.getStatusCode()));
// Fetch the translations again
response =
transResource.getTranslations("my.txt", de_DE, new StringSet(
"gettext"));
translations = response.getEntity();
assertThat(translations.getTextFlowTargets().size(), greaterThan(0));