private void assembleDefaultTranslation(Key key, KeyRepresentation keyRepresentation, String defaultLocale) { if (key.isTranslated(defaultLocale)) { Translation translation = key.getTranslation(defaultLocale); keyRepresentation.setTranslation(translation.getValue()); keyRepresentation.setApprox(translation.isApproximate()); } else { keyRepresentation.setMissing(true); } } }
@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()); } }
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 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()); } }