2

I am using the following code to populate data in a drop down. The purpose of the drop down is to offer a user a selection of Content Types:

    <select
        data-ng-disabled="!selectedSubject"
        data-ng-model="selectedContentType"
        data-ng-options="item.id as item.name for item in contentTypes">
        <option style="display: none" value="">Select Content Type</option>
    </select>

I have seen examples of Internationalization but am unsure of which way Angular will go and which they may incorporate into the later versions.

Can anyone give me some hint/tips as to a good course of action for me to help me to implement internationalization. Also in particular for any solution proposed then how could I incorporate this into a drop down select list like this one.

Alan2
  • 23,493
  • 79
  • 256
  • 450

1 Answers1

4
<select
    data-ng-disabled="!selectedSubject"
    data-ng-model="selectedContentType"
    data-ng-options="item.id as (item.name | myInternationalizationFilter ) for item in contentTypes">
    <option style="display: none" value="">( 'selectContentType' | myInternationalizationFilter </option>
</select>

You can run the item.name through a filter that you've created to handle the internationalization.

Mathew Berg
  • 28,625
  • 11
  • 69
  • 90