static
Class jsbeans.i18n
static
String
get
(
msgId
,
[replacers]
)
setLanguage by its {@param} msdId.msgId
<String>
the message id
[replacers]
<Array | JSON | arguments} ordered values for placeholders; may be key/value pairs in case of JSON format. May be an Array (jsbeans.i18n.get('label', ['Mr', 'Jones'])) or the function arguments (jsbeans.i18n.get('label', 'Mr', 'Jones')) or JSON (jsbeans.i18n.get('label', { title: 'Mr', lastName: 'Jones'>
))
String
static
boolean
has
(
msgId
)
msgId has been provided
msgId
<String>
the id of the message to be checked
boolean
jsbeans.i18n.BASE[msgId] has been found
static
void
put
(
selector
,
msgId
,
[replacers]
)
selector with message identified by {@param} msgId.jsbeans.i18n.get to get message.
selector
<String>
the id of an HTML element
msgId
<String>
the id of the message
[replacers]
<Array | JSON | arguments>
See jsbeans.i18n.get.
void
static
void
putAll
(
json
)
jsbeans.i18n.put (without replacers).
json
<JSON>
a json in the format
nameOfSelector1: msgIdForSelector1, nameOfSelector2: msgIdForSelector2, ...
void
static
void
setBase
(
obj
)
get uses jsbeans.i18n as base object for messages.jsbeans.i18n.get("mama"); will look for the property jsbeans.i18n.mama.setBase to change message container.jsbeans.i18n.setLanguage still looks for jsbeans.i18n._languages to check language availability.
obj
<JSON>
A JSON containing all messages. Default jsbeans.i18n.
void
static
void
setLanguage
(
lang
)
lang
<String>
the language used to get all next messages
void
static
void
setLocale
(
lang
)
setLanguage
lang
<String>
the language used to get all next messages
void
static
document.write
write
(
msgId
,
[replacers]
)
jsbeans.i18n.get but writes on document using document.write
msgId
<String>
[replacers]
<Array | JSON | arguments>
See jsbeans.i18n.get.
document.write