Changes between Version 13 and Version 14 of Internationalization
- Timestamp:
- Apr 19, 2014, 11:29:41 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Internationalization
v13 v14 5 5 To internationalize a caption or tooltip (or any other XML attribute) of a GUI XML `object` element, remove the attribute from the `object` element that contains it, and add a new `translatableAttribute` element within the `object` element that used to contain the old attribute, with the name of the old attribute as the value of the `id` attribute of this new element, and the value of the old attribute as the content of this new element. 6 6 7 ''' Note:'''Use "caption" as id of translatableAttribute to translate the caption of an object element.7 ''' Note:''' Use "caption" as id of translatableAttribute to translate the caption of an object element. 8 8 9 9 '''Original:''' … … 134 134 }}} 135 135 == Formatting Dates in JavaScript == 136 Given a date in [http://en.wikipedia.org/wiki/Unix_time UNIX time] , you can format the date using the following engine function:136 Given a date in [http://en.wikipedia.org/wiki/Unix_time UNIX time] (in milliseconds, not in seconds), you can format the date using the following engine function: 137 137 138 138 {{{ 139 dateString = Engine.FormatMillisecondsIntoDateString(unixTime *1000, translate("yyyy-MM-dd HH:mm:ss"));139 dateString = Engine.FormatMillisecondsIntoDateString(unixTime, translate("yyyy-MM-dd HH:mm:ss")); 140 140 }}} 141 If you have a !JavaScript [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date Date] object, you can use [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime Date.getTime()] to obtain the UNIX time in milliseconds: 142 143 {{{ 144 dateString = Engine.FormatMillisecondsIntoDateString(date.getTime(), translate("yyyy-MM-dd HH:mm:ss")); 145 }}} 146 147 141 148 You can modify the format string (second parameter) as you wish, using any [https://sites.google.com/site/icuprojectuserguide/formatparse/datetime?pli=1#TOC-Date-Field-Symbol-Table ICU date formatting symbols]. 142 149