public void translate() {
    if (translationService == null) {
      title.setValue(titleKey.getValue());
      return;
    }

    if (!Strings.isNullOrEmpty(titleKey.getValue())) {
      title.setValue(translationService.translate(titleKey.get()));
    }
  }
public void translate ( ) { if ( translationService == null ) { title . setValue ( titleKey . getValue ( ) ) ; return ; } if ( ! Strings . isNullOrEmpty ( titleKey . getValue ( ) ) ) { title . setValue ( translationService . translate ( titleKey . get ( ) ) ) ; } }
Updates the title based on the titleKey for i18n.
If there is no translationService, the title will be the same as the titleKey.
If there is a translationService, the titleKey will be used to lookup the translated variant
using the translationService and the title is set.