I have this enum
of countries:
public enum Country
{
[Display(Description ="Netherlands", ResourceType = typeof(MyResource))]
Netherlands = 0,
[Display(Description = "Germany", ResourceType = typeof(MyResource))]
Germany = 1,
[Display(Description = "Belgium", ResourceType = typeof(MyResource))]
Belgium = 2,
[Display(Description = "Luxembourg", ResourceType = typeof(MyResource))]
Luxembourg = 3,
[Display(Description = "France", ResourceType = typeof(MyResource))]
France = 4,
[Display(Description = "Spain", ResourceType = typeof(MyResource))]
Spain = 5
}
And this is an extension method to display the enums in a MultiSelectList
:
public static MvcHtmlString MultiSelectBoxFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, IEnumerable<SelectListItem> selectList)
{
return htmlHelper.ListBoxFor(expression, selectList, new { @class = "chzn-select", data_placeholder = Form.MultiSelect });
}
This MultiSelectList
has the 'chosen' style. See this site for more info
This all worked fine when I didn't need it to support more languages etc.
How can I make this work with localization?