EnumAttribute extends ImmutableValueAttribute<E,EnumAttribute<E>> { public String internal_enumDisplayText(E enumValue,Function<LanguageText,String> uniformDesign){ if (enumValue==null){ return "-"; } if (enumTranslations!=null){ return enumTranslations.getDisplayText(enumValue,uniformDesign); } return enumValue.name(); } EnumAttribute();  EnumAttribute(Consumer<EnumAttribute<E>> setup); EnumAttribute<E> deEnum(E value, String text); EnumAttribute<E> enEnum(E value, String text); String internal_enumDisplayText(E enumValue,Function<LanguageText,String> uniformDesign);  }
@Test public void test_enum_i18n_empty(){ EnumAttribute<TestEnum> attribute= new EnumAttribute<>(); Assertions.assertEquals("FGDFGDFGDFGDDFG_AA",attribute.internal_enumDisplayText(TestEnum.FGDFGDFGDFGDDFG_AA, languageText -> languageText.internal_getPreferred(Locale.GERMAN))); Assertions.assertEquals("FGDFGDFGDFGDDFG_AA",attribute.internal_enumDisplayText(TestEnum.FGDFGDFGDFGDDFG_AA, languageText -> languageText.internal_getPreferred(Locale.ENGLISH))); }