Changes between Version 13 and Version 14 of Internationalization


Ignore:
Timestamp:
Apr 19, 2014, 11:29:41 AM (10 years ago)
Author:
Adrián Chaves
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Internationalization

    v13 v14  
    55To 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.
    66
    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.
    88
    99'''Original:'''
     
    134134}}}
    135135== 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:
     136Given 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:
    137137
    138138{{{
    139 dateString = Engine.FormatMillisecondsIntoDateString(unixTime*1000, translate("yyyy-MM-dd HH:mm:ss"));
     139dateString = Engine.FormatMillisecondsIntoDateString(unixTime, translate("yyyy-MM-dd HH:mm:ss"));
    140140}}}
     141If 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{{{
     144dateString = Engine.FormatMillisecondsIntoDateString(date.getTime(), translate("yyyy-MM-dd HH:mm:ss"));
     145}}}
     146
     147
    141148You 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].
    142149