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

Commit

Permalink
rhbz953734 - refactor following api TranslationStatistics refactoring
Browse files Browse the repository at this point in the history
api commit 24e9c9aef663389d49ba3c7c47564ebacd3fbd82
  • Loading branch information
Patrick Huang committed May 22, 2013
1 parent eb19b23 commit 00e2f57
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Expand Up @@ -241,9 +241,9 @@ public void refreshStatistic()
TranslationStatistics stats = iterationStats.getStats(var.getLocaleId().getId(), statsOption);
if (stats == null)
{
stats = new TranslationStatistics();
stats = new TranslationStatistics(statsOption);
stats.setUntranslated(total);
stats.setTotal(total);
// stats.setTotal(total);
}

if (statsMap.containsKey(var.getLocaleId()))
Expand Down Expand Up @@ -278,9 +278,9 @@ public List<Status> getAllStatus()
TranslationStatistics stats = iterationStats.getStats(var.getLocaleId().getId(), statsOption);
if (stats == null)
{
stats = new TranslationStatistics();
stats = new TranslationStatistics(statsOption);
stats.setUntranslated(total);
stats.setTotal(total);
// stats.setTotal(total);

HTextFlowTarget lastTranslatedTarget = localeServiceImpl.getLastTranslated(projectSlug, iterationSlug, var.getLocaleId());

Expand Down
Expand Up @@ -123,21 +123,21 @@ private void setupLayoutPanel(double undefinedLeft, double undefinedWidth, doubl

public void refresh()
{
int approved, needReview, untranslated, saved, total;
int approved, draft, untranslated, translated, total;
if (statsByWords)
{
approved = getWordsApproved();
needReview = getWordsDraft();
draft = getWordsDraft();
untranslated = getWordsUntranslated();
saved = getWordsTranslated();
translated = getWordsTranslated();
total = getWordsTotal();
}
else
{
approved = getUnitApproved();
needReview = getUnitDraft();
draft = getUnitDraft();
untranslated = getUnitUntranslated();
saved = getUnitTranslated();
translated = getUnitTranslated();
total = getUnitTotal();
}
int width = getOffsetWidth();
Expand All @@ -151,8 +151,8 @@ public void refresh()
else
{
int completePx = approved * 100 / total * width / TOTAL_WIDTH;
int savedPx = saved * 100 / total * width / TOTAL_WIDTH;
int inProgressPx = needReview * 100 / total * width / TOTAL_WIDTH;
int savedPx = translated * 100 / total * width / TOTAL_WIDTH;
int inProgressPx = draft * 100 / total * width / TOTAL_WIDTH;
int unfinishedPx = untranslated * 100 / total * width / TOTAL_WIDTH;

int needReviewLeft = savedPx + completePx;
Expand Down

0 comments on commit 00e2f57

Please sign in to comment.