Selection dropdown values not culture specific

Vote:
 

Although forms supports multi language, it doesn't seem as though you are able to provide the values for a dropdown in anything other than the base language. 

Steps to reproduce:

Create a new form and add a Selection element. 

Switch to another language

You can't provide options in the needed language.

#202980
Apr 04, 2019 20:27
Vote:
 

Hi Kenny,

I seem to recall coming across a similar problem and the way we approached it was to create an initialization module which updated the definition of the SelectionElementBlock to set the Items property to be localisable. If you want to do it manually, you could go into "admin" > "Content Type" > "[Basic Elements] Selection" then check the "Unique value per language" checkbox.

#202990
Apr 05, 2019 10:31
Vote:
 

Thanks Paul, I did end up investigating the manual route yesterday but realized for this client that I didn't necessarily want to affect all Selection Element Blocks. (They have a Locations dropdown and it's kind of a pain to keep replicating.) 

So I approached this from another direction. I created a CultureSpecificSelectionElementBlock that inherits from SelectionElementBlock and made the Items CultureSpecific.

    public class CultureSpecificSelectionBlock : SelectionElementBlock
    {
        [CultureSpecific]
        public override IEnumerable<OptionItem> Items { get; set; }
    }

This way I can use the custom block for when I want the options language specific and the out-of-the-box Selection block when it doesn't matter.

#203006
Apr 05, 2019 16:30
Vote:
 

Also, I feel I should point out that I think I get WHY the options aren't automatically CultureSpecific. You probably want the submitted value to be the same even when the visible text is specific to the user. With nothing in place to copy those over it would be up to the editor.

#203010
Apr 05, 2019 16:53
Vote:
 

If anyone is interested I've got a blog post where I go into a deeper dive about custom form elements.

#204435
May 31, 2019 21:35
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.