Filter Preferred Languages. Should contain only specific languages.
-
When adding the field "user.preferredLanguages" to a Form the options contain a huge liste of selectable languages.
How can we configure it to contain only a few specific languages?
-
@egli Are you using this from the admin screen?
If so, this is not currently possible. Please feel free to file a feature request explaining your desired use case: https://github.com/fusionauth/fusionauth-issues/issues
Thanks!
-
@dan said in Filter Preferred Languages. Should contain only specific languages.:
@egli Are you using this from the admin screen?
I've added it here:
@dan said in Filter Preferred Languages. Should contain only specific languages.:
If so, this is not currently possible.
Is there any other way to add it and restrict the amount of languages?
I'll post it on GH as well.
-
Hiya @egli !
Thanks for posting it on GitHub issues. Please share the link so others discovering this issue can upvote it or see the progress on it.
Currently there's no way to limit the inputs on the default select box.
Two options.
Since you are using a custom form, you could create your own select list with just the languages you want to support.
Store this to a different value (
user.data.custom_preferred_languages
). You could then set up auser.create.complete
webhook to copy the value ofuser.data.custom_preferred_languages
to user.preferredLanguages`. That way this language will be used in the future. (The initial email won't have that info, however).Another option would be to have a javascript function that would run whenever the
user.preferredLanguage
select box is displayed, and would trim the values down to what you desire.I realize this isn't the smoothest, but it should get you the control you want.