Built-In Namespace _global_
Field Attributes | Field Name and Description |
---|---|
Internet Explorer version number, or undefined if using a real browser.
|
|
Boolean indicating the MacOS platform.
|
Method Attributes | Method Name and Description |
---|---|
_(text)
Translates a string.
|
|
constant(x)
Constant function.
|
|
Empty function.
|
|
extend(parent, prototype)
Creates the prototype object of a subclass.
|
|
format(string, params)
Formats a string by replacing printf-style format specifiers in the string
with dynamic parameters.
|
|
getInterval(t, until)
Formats an interval as a string
|
|
gettext(text)
Translates a string.
|
|
identity(x)
Identity function.
|
|
isEmpty(x)
Returns whether an object is empty.
|
|
loadModule(name)
Loads a module at runtime.
|
|
ngettext(singular, plural, n)
Translates a string containing numbers.
|
|
noI18n(text)
Converts a string to I18nString without translation.
|
|
npgettext(context, singular, plural, n)
Translates a string containing numbers with context.
|
|
pgettext(context, text)
Translates a string with context
|
Field Detail
IE
Internet Explorer version number, or undefined if using a real browser.
Since comparisons with undefined always return false, checks involving this
variable should use the "<" or "<=" operators, e. g. "if (IE < 8)".
Defined in: util.js.
Defined in: util.js.
Mac
Boolean indicating the MacOS platform. If true, selections use the Meta key
instead of the Ctrl key.
Defined in: util.js.
Defined in: util.js.
Method Detail
{I18nString}
_(text)
Translates a string.
Defined in: modules.js.
Defined in: modules.js.
- Parameters:
- {String} text
- The original English text to translate.
- Returns:
- The translated text.
{Function}
constant(x)
Constant function.
Returns a new function which returns the first parameter of this function.
Defined in: util.js.
Defined in: util.js.
- Parameters:
- x
- Returns:
- A function which returns x.
emptyFunction()
Empty function. Does nothing.
Defined in: util.js.
Defined in: util.js.
{Object}
extend(parent, prototype)
Creates the prototype object of a subclass.
Defined in: util.js.
Defined in: util.js.
- Parameters:
- {Function} parent
- The constructor function of the superclass.
- {Object} prototype
- The prototype object of the subclass, containing only new and overridden members.
- Returns:
- The prototype object with all inherited members added to it.
{I18nString}
format(string, params)
Formats a string by replacing printf-style format specifiers in the string
with dynamic parameters. Flags, width, precision and length modifiers are
not supported. All type conversions are performed by the standard toString()
JavaScript method.
Defined in: i18n.js.
Defined in: i18n.js.
- Parameters:
- {I18nString} string
- The format string.
- params
- Either an array with parameters or multiple separate parameters.
- Returns:
- The formatted string.
getInterval(t, until)
Formats an interval as a string
Defined in: i18n.js.
Defined in: i18n.js.
- Parameters:
- {Number} t
- The interval in milliseconds
- {Boolean} until
- Specifies whether the returned text should be in objective case (if true) or in nominative case (if false).
{I18nString}
gettext(text)
Translates a string.
Defined in: modules.js.
Defined in: modules.js.
- Parameters:
- {String} text
- The original English text to translate.
- Returns:
- The translated text.
identity(x)
Identity function. Returns its first parameter.
Defined in: util.js.
Defined in: util.js.
- Parameters:
- x
{Boolean}
isEmpty(x)
Returns whether an object is empty.
Defined in: util.js.
Defined in: util.js.
- Parameters:
- {Object} x
- The tested object
- Returns:
- True if the object does not have enumerable properties, false otherwise.
loadModule(name)
Loads a module at runtime.
Loading a module which is already (being) loaded has no effect.
The register.js file from the module's directory is converted to the body of
a function and that function is called without parameters.
The file is downloaded asynchronously.
Defined in: modules.js.
Defined in: modules.js.
- Parameters:
- {String} name
- The name of the module to load.
{I18nString}
ngettext(singular, plural, n)
Translates a string containing numbers.
Defined in: modules.js.
Defined in: modules.js.
- Parameters:
- {String} singular
- The original English text for the singular form.
- {String} plural
- The original English text for the plural form.
- {Number} n
- The number which determines which text form is used.
- Returns:
- The translated text.
{I18nString}
noI18n(text)
Converts a string to I18nString without translation.
Defined in: modules.js.
Defined in: modules.js.
- Parameters:
- {String} text
- The text to conevrt.
- Returns:
- The untranslated text as I18nString.
{I18nString}
npgettext(context, singular, plural, n)
Translates a string containing numbers with context.
Defined in: modules.js.
Defined in: modules.js.
- Parameters:
- {String} context
- A context to differentiate multiple identical texts with different translations.
- {String} singular
- The original English text for the singular form.
- {String} plural
- The original English text for the plural form.
- {Number} n
- The number which determines which text form is used.
- Returns:
- The translated text.
{I18nString}
pgettext(context, text)
Translates a string with context
Defined in: modules.js.
Defined in: modules.js.
- Parameters:
- {String} context
- A context to differentiate multiple identical texts with different translations.
- {String} text
- The original English text to translate.
- Returns:
- The translated text.