/** * Checks if the key has outdated translation * and then update the outdated indicator of the key. */ public void updateOutdated() { outdated = false; for (Translation translation : translations.values()) { if (translation.isOutdated()) { outdated = true; } } }
/** * Checks if the key has outdated translations and then update the outdated status of the key. */ public void checkOutdatedStatus() { boolean newStatus = false; for (Translation translation : translations.values()) { if (translation.isOutdated()) { newStatus = true; break; } } outdated = newStatus; }
private TranslationValueRepresentation assembleTranslation(Key key, String locale) { TranslationValueRepresentation source = new TranslationValueRepresentation(); source.setLocale(locale); Translation translation = key.getTranslation(locale); source.setTranslation(translation.getValue()); source.setApprox(translation.isApproximate()); source.setOutdated(translation.isOutdated()); return source; }
@Override public void mergeAggregateIntoDto(Key sourceAggregate, KeyDTO targetDto) { targetDto.setName(sourceAggregate.getId()); targetDto.setComment(sourceAggregate.getComment()); targetDto.setOutdated(sourceAggregate.isOutdated()); for (Translation tln : sourceAggregate.getTranslations().values()) { targetDto.addTranslationDTO(tln.getId().getLocale(), tln.getValue(), tln.isOutdated(), tln.isApproximate()); } }
@Override protected void doAssembleDtoFromAggregate(KeyDTO targetDto, Key sourceEntity) { targetDto.setName(sourceEntity.getEntityId()); targetDto.setComment(sourceEntity.getComment()); targetDto.setOutdated(sourceEntity.isOutdated()); for (Translation tln : sourceEntity.getTranslations().values()) { targetDto.addTranslationDTO(tln.getEntityId().getLocale(), tln.getValue(), tln.isOutdated(), tln.isApproximate()); } }