Child pages
  • i18n

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
{div:style=}
Wiki Markup
Div
styledisplay:none

DO

NOT

EDIT

THE

CONTENT

OF

THIS

PAGE

DIRECTLY

(EXCEPT

INSIDE

THE

DIV

BELOW

WITH

ID=DESCRIPTION),

UNLESS

YOU

KNOW

WHAT

YOU'RE

DOING.


THE

STRUCTURE

OF

THE

CONTENT

IS

VITAL

IN

BEING

ABLE

TO

AUTO

UPDATE

THE

CONTENT

THROUGH

THE

DOC

GENERATOR.

\\ \\ Enter additional information related to this



Enter additional information related to this 'class'

inside

the

\

{div}

macro

with

'id=description'

{div} {div:id=description}{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#getCurrentLanguage]\() Gets the current language; based on the current locale settings in the Servoy Client Locale preferences.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getI18NMessage]\(i18nKey) Gets the real message (for the clients locale) for a specified message key.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getI18NMessage]\(i18nKey, dynamicValues) Gets the real message (for the clients locale) for a specified message key.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setI18NMessage]\(i18nKey, value) Sets the value of i18n key for client scope,if value null the setting is removed.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setLocale]\(language, country) Set/Overwrite the locale for this client.{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getCurrentLanguage}{tr:id=name}{td}h6.getCurrentLanguage{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getCurrentLanguage{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- a String representing the current language.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

Div
iddescription


HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getCurrentLanguage()
Gets the current language; based on the current locale settings in the Servoy Client Locale preferences.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getI18NMessage(i18nKey)
Gets the real message (for the clients locale) for a specified message key.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getI18NMessage(i18nKey, dynamicValues)
Gets the real message (for the clients locale) for a specified message key.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setI18NMessage(i18nKey, value)
Sets the value of i18n key for client scope,if value null the setting is removed.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setLocale(language, country)
Set/Overwrite the locale for this client.

HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idgetCurrentLanguage
Table Row (tr)
idname
Table Cell (td)
getCurrentLanguage
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getCurrentLanguage
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

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)
idret
Table Cell (td)
Returns
Div
classsIndent
String – a String representing the current language.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var currLang = i18n.getCurrentLanguage();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getI18NMessage-String}{tr:id=name}{td}h6.getI18NMessage{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getI18NMessage{span}{span}\(i18nKey){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Gets the real message (for the clients locale) for a specified message key.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} i18nKey -- The message key {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- a String that is the message for the message key.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetI18NMessage-String
Table Row (tr)
idname
Table Cell (td)
getI18NMessage
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getI18NMessage
Span
(i18nKey)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the real message (for the clients locale) for a specified message key.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} i18nKey – The message key
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String – a String that is the message for the message key.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// 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'))
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetI18NMessage-String_ObjectArray
}{
Table Row (tr)
:
id
=
name
}{td}h6.getI18NMessage{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
getI18NMessage
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
String
]{span}{span:style=
Span
stylefont-weight:
bold;
}
getI18NMessage
{span}{span}\
Span
(i18nKey,
dynamicValues)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} i18nKey -- The message key \{[Object]\[]} dynamicValues -- Arguments array when using parameter substitution. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- a String that is the message for the message key.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} i18nKey – The message key
{Object[]} dynamicValues – Arguments array when using parameter substitution.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String – a String that is the message for the message key.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

// 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'))
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetI18NMessage-String_String
}{
Table Row (tr)
:
id
=
name
}{td}h6.setI18NMessage{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
setI18NMessage
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}
void
{span}{span:style=
Span
stylefont-weight:
bold;
}
setI18NMessage
{span}{span}\
Span
(i18nKey,
value)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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){div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} i18nKey -- The message key \{[String]} value -- They value for the message key. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} i18nKey – The message key
{String} value – They value for the message key.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

//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')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetLocale-String_String
}{
Table Row (tr)
:
id
=
name
}{td}h6.setLocale{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
setLocale
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}
void
{span}{span:style=
Span
stylefont-weight:
bold;
}
setLocale
{span}{span}\
Span
(language,
country)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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\-639. see
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

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-639.
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{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} language -- The lowercase 2 letter code \{[String]} country -- The upper case 2 letter code. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

i18n

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} language – The lowercase 2 letter code
{String} country – The upper case 2 letter code.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

//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');
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)