for (LocaleId localeId : localeIds) {
ContainerTranslationStatistics docStats =
getDocStatistics(document.getId(), localeId);
DocumentStatus docStatus =
translationStateCacheImpl.getDocumentStatus(
document.getId(), localeId);
TranslationStatistics docWordStatistic =
docStats.getStats(localeId.getId(), StatUnit.WORD);
TranslationStatistics docMsgStatistic =
docStats.getStats(localeId.getId(), StatUnit.MESSAGE);
docMsgStatistic
.setLastTranslatedBy(docStatus.getLastTranslatedBy());
docMsgStatistic.setLastTranslatedDate(docStatus
.getLastTranslatedDate());
docMsgStatistic.setLastTranslated(getLastTranslated(
docStatus.getLastTranslatedDate(),
docStatus.getLastTranslatedBy()));
docStatistics.addStats(docMsgStatistic);
// word level stats
if (includeWordStats) {
docWordStatistic.setLastTranslatedBy(docStatus
.getLastTranslatedBy());
docWordStatistic.setLastTranslatedDate(docStatus
.getLastTranslatedDate());
docWordStatistic.setLastTranslated(getLastTranslated(
docStatus.getLastTranslatedDate(),
docStatus.getLastTranslatedBy()));
docStatistics.addStats(docWordStatistic);
}
}
return docStatistics;
}