Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
Table Body (tbody) |
---|
id | getAvailableTimeZoneIDs |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getAvailableTimeZoneIDs |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String[] |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getAvailableTimeZoneIDs |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get the list of available time zones. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String[] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//Get the list of available time zones
var timezones = i18n.getAvailableTimeZoneIDs();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getCountries |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String[] |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getCountries |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Gets the list of countries available for localization |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String[] – a String array containing the available countries. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
i18n.getCountries()
|
|
|
|
|
Table Body (tbody) |
---|
id | getCurrentCountry |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getCurrentCountry |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getCurrentCountry |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Gets the current country; based on the current locale settings in the Servoy Client Locale preferences. NOTE: For more information on i18n, see the chapter on Internationalization (i18n) in the Servoy Developer User's Guide, beginning with the Introduction to i18n |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String – a String representing the current country. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var currCountry = i18n.getCurrentCountry();
|
|
|
|
|
Table Body (tbody) |
---|
id | getCurrentLanguage |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getCurrentLanguage |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getCurrentLanguage |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Gets the current language; based on the current locale settings in the Servoy Client Locale preferences. NOTE: For more information on i18n, see the chapter on Internationalization (i18n) in the Servoy Developer User's Guide, beginning with the Introduction to i18n |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String – a String representing the current language. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var currLang = i18n.getCurrentLanguage();
|
|
|
|
|
Table Body (tbody) |
---|
id | getCurrentTimeZone |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getCurrentTimeZone |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getCurrentTimeZone |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Gets the current time zone of the client; based on the current locale settings in the Servoy Client Locale preferences. For Servoy Web Clients the time zone is given by the browser (if it is possible to obtain it). |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String – a String representing the current time zone. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var currTimeZone = i18n.getCurrentTimeZone();
|
|
|
|
|
Table Body (tbody) |
---|
id | getDefaultDateFormat |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getDefaultDateFormat |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Gets the current default date format; based on the current locale settings in the Servoy Client Locale preferences. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String – a String representing the default date format. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var defaultDateFormat = i18n.getDefaultDateFormat();
|
|
|
|
|
Table Body (tbody) |
---|
id | getDefaultNumberFormat |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getDefaultNumberFormat |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Gets the current default number format; based on the current locale settings in the Servoy Client Locale preferences. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String – a String representing the default number format. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var defaultNumberFormat = i18n.getDefaultNumberFormat();
|
|
|
|
|
Table Body (tbody) |
---|
id | getI18NMessage-String |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getI18NMessage |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getI18NMessage |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Gets the real message (for the clients locale) for a specified message key. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} i18nKey – The message key |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String – a String that is the message for the message key. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
// returns 'Welcome my_name in my solution'
// if the key 'mykey.username.text' is 'Welcome {0} in my solution'
i18n.getI18NMessage('mykey.username.text',new Array('my_name'))
|
|
|
|
|
Table Body (tbody) |
---|
id | getI18NMessage-String_ |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getI18NMessage |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getI18NMessage |
Span |
---|
| (i18nKey, dynamicValues) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Gets the real message (for the clients locale) for a specified message key. You can use parameter substitution by using {n}, where n is a index number of the value thats in the arguments array. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} i18nKey – The message key {Object[]} dynamicValues – Arguments array when using parameter substitution. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String – a String that is the message for the message key. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
// returns 'Welcome my_name in my solution'
// if the key 'mykey.username.text' is 'Welcome {0} in my solution'
i18n.getI18NMessage('mykey.username.text',new Array('my_name'))
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getLanguages |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| JSDataSet |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getLanguages |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns JSDataSet – a JSDataSet with all the languages. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var set = i18n.getLanguages();
for(var i=1;i<=set.getMaxRowIndex();i++)
{
application.output(set.getValue(i, 1) + " " + set.getValue(i, 2));
}
|
|
|
|
|
Table Body (tbody) |
---|
id | getSystemMessages |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getSystemMessages |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| JSDataSet |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getSystemMessages |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns a dataset with rows that contains 3 columns: 'key' (i18n key), 'reference' (reference text for that key) and 'locale ([CURRENT_LOCALE])' (where [CURRENT_LOCALE] is the current language) - with the system messages of servoy. This means all servoy messages, with all available translations. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns JSDataSet – a JSDataSet with all the system messages. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var set = i18n.getSystemMessages();
for(var i=1;i<=set.getMaxRowIndex();i++)
{
application.output(set.getValue(i, 1) + " " + set.getValue(i, 2)+ " " + set.getValue(i, 3));
}
|
|
|
|
|
Table Body (tbody) |
---|
id | getTimeZoneOffset |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getTimeZoneOffset |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getTimeZoneOffset |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns the offset (in milliseconds) of this time zone from UTC for the current date or at the specified date. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters timezone – The time zone to get the offset for. [date] – The date in the time zone (default current date). Needed in case daylight saving time/GMT offset changes are used in the time zone. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Number – an int representing the time zone's offset from UTC. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var timeZoneOffset = i18n.getTimeZoneOffset('America/Los_Angeles');
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getTimeZones |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String[] |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getTimeZones |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an array of known timezones. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String[] – an Array with all the timezones. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var timeZones = i18n.getTimeZones();
|
|
|
|
|
Table Body (tbody) |
---|
id | setI18NMessage |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setI18NMessage |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setI18NMessage |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sets the value of i18n key for client scope,if value null the setting is removed. All forms not yet loaded will change (execute this in solution startup or first form) |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} i18nKey – The message key {String} value – They value for the message key. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//sets the value of i18n key for client scope; if value null the setting is removed
//Warning: already created form elements with i18n text lookup will not change,
//so call this method in the solution startup method or in methods from first form
//this method saves message for current locale, so if locale is changed with setLocale, all messages set from scripting will be lost
i18n.setI18NMessage('mykey.username.text','my_name')
|
|
|
|
|
Table Body (tbody) |
---|
id | setI18NMessagesFilter-String_String |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setI18NMessagesFilter |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setI18NMessagesFilter |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Call this if you want to add a filter for a column (created by you) in the i18n table. So that you can have multiple default values and multiple values per locale for one key. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} columnName – The column name that is the filter column in the i18n table. {String} value – The filter value. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
// Puts i18n in filter mode - this allows you to have multiple default/per locale
// values for one key and to use one of them based on the filter parameters.
// Let's say you added a new column "message_variant" to your i18n table.
// Now you can have keys that will translate to a language differently depending on the used variant
// For example you have 2 rows in you table for key X, language EN, different values and different "message_variant" (let's say 1 and 2)
// If you want the solution to use the first variant, you will have to call:
i18n.setI18NMessagesFilter('message_variant', '1')
// Using filter fall back : if there is no key for 'message_variant' with value '1', it will
// search for value '2'
var filterValue = new Array();
filterValue[0] = '1';
filterValue[1] = '2';
i18n.setI18NMessagesFilter('message_variant', filterValue)
// ATTENTION: if you use setI18NMessagesFilter(...) it is not recommended to use the i18n Dialog (especially before the filter is applied through JS).
|
|
|
|
|
Table Body (tbody) |
---|
id | setI18NMessagesFilter-String_ |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setI18NMessagesFilter |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setI18NMessagesFilter |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Call this if you want to add a filter for a column (created by you) in the i18n table. So that you can have multiple default values and multiple values per locale for one key. You can use filter fall back by setting the filter value as an array of strings. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} columnName – The column name that is the filter column in the i18n table. {String[]} value – The filter value. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
// Puts i18n in filter mode - this allows you to have multiple default/per locale
// values for one key and to use one of them based on the filter parameters.
// Let's say you added a new column "message_variant" to your i18n table.
// Now you can have keys that will translate to a language differently depending on the used variant
// For example you have 2 rows in you table for key X, language EN, different values and different "message_variant" (let's say 1 and 2)
// If you want the solution to use the first variant, you will have to call:
i18n.setI18NMessagesFilter('message_variant', '1')
// Using filter fall back : if there is no key for 'message_variant' with value '1', it will
// search for value '2'
var filterValue = new Array();
filterValue[0] = '1';
filterValue[1] = '2';
i18n.setI18NMessagesFilter('message_variant', filterValue)
// ATTENTION: if you use setI18NMessagesFilter(...) it is not recommended to use the i18n Dialog (especially before the filter is applied through JS).
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setLocale |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Set/Overwrite the locale for this client. All forms not yet loaded will change (execute this in solution startup or first form). The language must be a lowercase 2 letter code defined by ISO-649. see http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt The country must be an upper case 2 letter code defined by IS-3166 see http://www.chemie.fu\-berlin.de/diverse/doc/ISO\_3166.html NOTE: For more information on i18n, see the chapter on Internationalization (i18n) in the Servoy Developer User's Guide, beginning with the Introduction to i18n |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} language – The lowercase 2 letter code {String} country – The upper case 2 letter code. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//Warning: already created form elements with i18n text lookup will not change,
//so call this method in the solution startup method or in methods from first form
i18n.setLocale('en','US');
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setTimeZone |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setTimeZone |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sets the current time zone of the client. The parameter should be a string having the format which can be retrieved via i18n.getAvailableTimeZones or can be seen in the SmartClient Edit -> Preferences -> Locale at the "Default Timezone" combobox. For instance the time zone for Netherlands is set using the ID "Europe/Amsterdam". |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
// This will set the default time zone to Central European Time
i18n.setTimeZone("Europe/Amsterdam");
|
|
|
|
|
|