cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.Select Internationalization (i18n)

Former Member
0 Kudos
200

Hi Experts,

I have a requirement to display a select box in different languages based on user logon.

I have created a sap.m.select box and bind it to Local JSON Model. This select box display the Weeks. Please refer below screen shot.

I have maintained the i18n folder and able to convert the view text into different languages.

Following is the XML code:

<Select id="idSelectWeek" width="10em" change="onSelectWeekChange"

   autoAdjustWidth="true" items="{localDataModel>/Weeks}" selectedKey="0">

  <core:Item key="{localDataModel>id}" text="{localDataModel>text}"

</Select>

Local JSON Model:

{

    "Weeks": [

        {

            "id": "0",

            "type": "W1",

            "text": "Week 1"

        },

        {

            "id": "1",

            "type": "W2",

            "text": "Week 2"

        },

        {

            "id": "2",

            "type": "W3",

            "text": "Week 3"

        },

        {

            "id": "3",

            "type": "W4",

            "text": "Week 4"

        },

        {

            "id": "4",

            "type": "W5",

            "text": "Week 5"

        }

    ]

}

Please guide me through the solution.

Thanks in advance.

Regards,

Abhijeet

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

Have a look into the concept of localization in sapui5. the below link will provide the concept of it,

Use of Localized Texts in Applications - UI Development Toolkit for HTML5 (SAPUI5) - SAP Library