I will appreciate any ideas of how to fix the following problem. In milti-language application I have a page, where I declare a drop-down list to show the list of customers from DB table:
@Html.DropDownListFor(m => m.CustomerId, new SelectList(Model.Customers, "Id", "Name", Model.CustomerId), new { @class = "form-control select2-customer", id = "select2-customer", multiple = "multiple" })
For the DropDownListFor I use select2. select2 is defined in the shared page:
$(".select2-customer").select2({
placeholder: '@Localization.SelectCustomer',
allowClear: true
});
The value for placeholder comes from the Localization file, where I have a definition for French: https://i.stack.imgur.com/tp9Q3.png
Name: SelectCustomer
Value: Sélectionner un client
Problem: When I run the application and then change language from English to French, text in French in all places (UI, items of drop-down lists, navigation menu, etc.) is ok, but the placeholder is broken: it shows Sélectionner un client instead of expected Sélectionner un client
I tried off to wrap the placeholder value with @Html.Raw, HttpUtility.HtmlDecode - it didn't help.
Thanks!