cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Copy all localizations from an attribute to another

Former Member
0 Kudos
317

I want to copy all existing translations for a localized attribute (eg countryName) to another localized attribute in another object. If there is better solution than allLanguages.foreach(l->l ......) Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Jalo object has what you need. Example:

     SomeObject jaloObject = modelService.getSource(source);
     Map<Language, String> localizationMap = jaloObject.getAllLocalizedProp();
     localizationMap.forEach((key, value) -> {
             target.setLocalizedProp(value, key.getLocale());
     });