Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Changes in zanata:push progress indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Oct 10, 2012
1 parent 3dd9be5 commit 82ae601
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -429,27 +429,27 @@ private void pushTargetDocToServer(final String docUri, LocaleMapping locale, fi
{
if (!getOpts().isDryRun())
{
log.info("pushing target doc [name={} size={} client-locale={}] to server [locale={}]", new Object[] { srcDoc.getName(), targetDoc.getTextFlowTargets().size(), locale.getLocalLocale(), locale.getLocale() });
log.info("Pushing target doc [name={} size={} client-locale={}] to server [locale={}]", new Object[] { srcDoc.getName(), targetDoc.getTextFlowTargets().size(), locale.getLocalLocale(), locale.getLocale() });

List<TranslationsResource> targetDocList = splitIntoBatch(targetDoc, getOpts().getBatchSize());

int totalDone = 0;
ConsoleUtils.startProgressFeedback();
for (TranslationsResource doc : targetDocList)
{
ConsoleUtils.startProgressFeedback();

ClientResponse<String> putTransResponse = translationResources.putTranslations(docUri, new LocaleId(locale.getLocale()), doc, extensions, getOpts().getMergeType());
ConsoleUtils.endProgressFeedback();

totalDone = totalDone + doc.getTextFlowTargets().size();
ConsoleUtils.setProgressFeedbackMessage(totalDone + "/" + targetDoc.getTextFlowTargets().size());

ClientUtility.checkResult(putTransResponse, uri);
String entity = putTransResponse.getEntity(String.class);
if (entity != null && !entity.isEmpty())
{
log.warn("{}", entity);
}
totalDone = totalDone + doc.getTextFlowTargets().size();
log.info("Pushed " + totalDone + " of " + targetDoc.getTextFlowTargets().size() + " entries");
}
ConsoleUtils.endProgressFeedback();
}
else
{
Expand Down

0 comments on commit 82ae601

Please sign in to comment.