This is a migrated thread and some comments may be shown as answers.

OptionLabel localization

3 Answers 171 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Michel
Top achievements
Rank 1
Michel asked on 11 Feb 2017, 04:40 PM

Is there a way to localize the optionlabel text a bit like that:

....

  .OptionLabel(@Localizer["MyLocalizedOptionLabel"].Value)

....

Thanks

3 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 14 Feb 2017, 03:09 PM
Hello Michael,

I am afraid that no tests are provided against usage of such Localizer. We suggest the use demonstrated in the following article:

http://docs.telerik.com/aspnet-mvc/getting-started/localization#defaults


You can observe how to add new Localization or change current messages in the resource above. However, if you are able to evaluate the needed message value, using the demonstrated approach (@Localizer["MyLocalizedOptionLabel"].Value), you should be able to set it as OptionalLabel

Regards,
Nencho
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Michel
Top achievements
Rank 1
answered on 14 Feb 2017, 08:27 PM

Hi Nencho,

Thanks for your reply but what I have forget to tell is that it is related to a dropdownlist in a popup editor.

In a standard view, localization works well as expected.

There is also a problem for localizing other control like a label or others.

          <label class="control-label">@Localizer["MyLocalizedOptionLabel"]</label>

What is displayed is "MyLocalizedOptionLabel" instead of the value of the MyLocalizedOptionLabel key in the resource file. The same is true for OptionLabel in a popup editor.

Any other suggestions ?

0
Nencho
Telerik team
answered on 16 Feb 2017, 01:25 PM
Hello Michael,

I am afraid that the issue indeed does not seems to be related with our products directly. I can suggest you however, to refer to the following thread, where an implementation that you might find suitable is provided:

http://stackoverflow.com/questions/2431333/displayname-attribute-from-resources


Regards,
Nencho
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
DropDownList
Asked by
Michel
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Michel
Top achievements
Rank 1
Share this question
or