Attribute in UserProfile with translated/language-specific options

Hi all,
does anyone of you know if and if yes, how, it is possible to have i18n options in the declarative user profile?

So, e.g., I’m creating a custom managed attribute “department” and add the options validator with several option values. In the annotation I have the inputType=select.
On the realm, localization is enabled with several languages.
Now, I want somehow the options of the select box being displayed in admin/account/registration ui to appear in some language-specific translation, e.g. having the option value “sales”, should be displayed for English as “Sales” and Germany as “Vertrieb”. Best: the internal value is still “sales”.

Is this somehow possible without adjusting the Freemarker template code for this?
Does this anybody know? I tried several things, but so far no success…
Thanks for your help in advance! :slight_smile:

1 Like

Afaik, you can use the annotation “inputOptionLabelsI18nPrefix” for this purpose. For example, you can define translations in theme files (or “realm overrides”) with keys like “our-position-options.sales” and “our-position-options.marketing” and define “our-position-options” as “inputOptionLabelsI18nPrefix” for the user profile attribute.

The translation will just affect the labels (“Sales” / “Vertrieb”) - the value will be persisted as “sales” in both cases.

1 Like

Thank you so much, @danielFesenmeyer
As soon as you know this, you can’t oversee it anymore and it seems obvious :man_facepalming:
But before I really didn’t see it. I looked everywhere and tried so many approaches. Silly me.
Thanks again for this hint!! :slight_smile:

1 Like