Skip to Content
0
Former Member
May 14, 2015 at 06:22 AM

sap.m.Select Internationalization (i18n)

142 Views

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

Attachments

SelectBox.PNG (6.3 kB)