Skip to Content

In SAP help, the determination of language code / locale is explained.

For example, when I access CRM application “My Appointment” with English language specified in url:

Https://<host>:<port>/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?sap-client=001&sap-language=EN#Appointment-myAppointments&/newappointment/20151014/ZXXX/true

The DatePicker looks like below:

/wp-content/uploads/2015/10/clipboard1_810469.png

When I try with Chinese:

Https://<host>:<port>/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?sap-client=001&sap-language=ZH#Appointment-myAppointments&/newappointment/20151014/ZXXX/true

/wp-content/uploads/2015/10/clipboard2_810500.png

What I woud like to know is how is “2015年10月15日” displayed.

Based on previous research on DatePicker, this task should be a little bit easier:

DateFormat in DatePicker control

More details of DatePicker

1. The place holders for Date display ( 年 – year, 月 – month, 日 – day ) for Chinese are stored in this.aFormatArray in DateFormat.js file.

/wp-content/uploads/2015/10/clipboard4_810501.png

2. this.aFormatArray is determined by this.oFormatOptions.pattern. For language = ZH, the patter is “y年M月d日”.

/wp-content/uploads/2015/10/clipboard5_810502.png

3. In Chrome network tab, we can observe a http request for file zh_CN.son.

/wp-content/uploads/2015/10/clipboard6_810506.png

The callstack which triggers this file request:

/wp-content/uploads/2015/10/clipboard7_810507.png

If we inspect the content of this file, we can find the “y年M月d日” in attribute dateFormat-medium and dateFormat-long:

/wp-content/uploads/2015/10/clipboard8_810508.png

The content of this file is parsed and merged into this.mData, which will be used to populate aFormatArray mentioned above.

/wp-content/uploads/2015/10/clipboard9_810509.png

The complete url for zh_CN.json:

https://<host>:<port>/sap/bc/ui5_ui5/ui2/ushell/resources/sap/ui/core/cldr/zh_CN.json

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply