|
Jala 1.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--jala.I18n
This class provides various functions and macros for
internationalization of Helma applications.
Defined in I18n.js
Constructor Summary | |
jala.I18n
()
Constructs a new instance of jala.I18n |
Method Summary | |
String
|
formatMessage(<String> message, <Array> values)
Converts the message passed as argument into an instance of java.text.MessageFormat, and formats it using the replacement values passed. |
Object
|
getCatalog(locale)
Helper method to get the message catalog corresponding to the actual locale. |
java.util.Locale
|
getLocale(localeId)
Returns the locale for the given id, which is expected to follow the form language[_COUNTRY][_variant] , where language
is a valid ISO Language Code (eg.
|
Function
|
getLocaleGetter()
Get the method for retrieving the locale. |
Object
|
getMessages()
Get the message object. |
String
|
gettext(<String> key )
Returns a localized message for the message key passed as argument. |
String
|
markgettext(<String> key)
A simple proxy method which is used to mark a message string for the i18n parser as to be translated. |
String
|
message_macro(param)
Returns a translated message. |
String
|
ngettext(<String> singularKey, <String> pluralKey, <Number> amount )
Returns a localized message for the message key passed as argument. |
void
|
setHandler(<Object> handler)
Set (overwrite) the default handler containing the messages (ie. |
void
|
setLocaleGetter(<Function> func)
Set the method for retrieving the locale. |
void
|
setMessages(<Object> msgObject)
Overwrite the default object containing the messages (ie. |
String
|
translate(singularKey, pluralKey, <Number> amount)
Tries to "translate" the given message key into a localized message. |
Constructor Detail |
jala.I18n()
Method Detail |
String formatMessage(<String> message, <Array> values)
message
- The message to format
values
- An optional array containing replacement values
Object getCatalog(locale)
java.util.Locale getLocale(localeId)
language[_COUNTRY][_variant]
, where language
is a valid ISO Language Code (eg. "de"), COUNTRY
a valid ISO
Country Code (eg. "AT"), and variant an identifier for the variant to use.Function getLocaleGetter()
Object getMessages()
String gettext(<String> key )
number
must
match the number of the additional argument (starting with zero).key
- The message to localize
String markgettext(<String> key)
key
- The message that should be seen by the i18n parser as to be translated.
String message_macro(param)
String ngettext(<String> singularKey, <String> pluralKey, <Number> amount )
number
must
match the number of the additional argument (starting with zero).singularKey
- The singular message to localize
pluralKey
- The plural form of the message to localize
amount
- The amount which is used to determine whether the singular or plural form of the message should be returned.
void setHandler(<Object> handler)
handler
- The handler containing the message object
void setLocaleGetter(<Function> func)
func
- The getter method
void setMessages(<Object> msgObject)
msgObject
- The object containing the messages
String translate(singularKey, pluralKey, <Number> amount)
amount
- A number to determine whether to use the singular or plural form of the message
key
- The message to translate (required)
plural
- The plural form of the message to translate
|
Jala 1.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |