FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Filter Preferred Languages. Should contain only specific languages.

    Scheduled Pinned Locked Moved Unsolved
    Q&A
    2
    4
    715
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      egli
      last edited by

      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?

      dcf18b2d-c947-4096-84bd-cf249b52fbbc-image.png

      f65858bc-267a-498d-a9f5-87a830e5f179-image.png

      danD 1 Reply Last reply Reply Quote 1
      • danD
        dan @egli
        last edited by

        @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!

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        E 1 Reply Last reply Reply Quote 0
        • E
          egli @dan
          last edited by

          @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:

          f8f19211-bfe7-4718-b8e8-49ee85f16e92-image.png

          @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.

          danD 1 Reply Last reply Reply Quote 0
          • danD
            dan @egli
            last edited by

            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 a user.create.complete webhook to copy the value of user.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.

            --
            FusionAuth - Auth for devs, built by devs.
            https://fusionauth.io

            1 Reply Last reply Reply Quote 0
            • First post
              Last post