Built-In Namespace _global_
Field Attributes | Field Name and Description |
---|---|
Utility function which checks for untranslated strings.
|
|
Internet Explorer version number, or undefined if using a real browser.
|
|
Boolean indicating the MacOS platform.
|
|
Converts a string to a translated string without translation.
|
Method Attributes | Method Name and Description |
---|---|
_(text)
Translates a string.
|
|
bindtextdomain(domain, pattern)
Adds a new i18n domain, usually for a plugin.
|
|
callback()
|
|
constant(x)
Constant function.
|
|
dnpgettext(domain, context, singular, plural, n)
Translates a string containing numbers.
|
|
dpgettext(domain, context, text)
Translates a string
|
|
Empty function.
|
|
escapeHTML(s)
Escapes a string to be included in an HTML file.
|
|
escapeRegExp(s)
Escapes a string to be included in a regular expression.
|
|
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.
|
|
formatDateTime(format, date)
Formats a Date object according to a format string.
|
|
getInterval(t, until)
Formats an interval as a string
|
|
Returns the day of the week which decides the week number
|
|
gettext(text)
Translates a string.
|
|
I18nString(toString)
A class for translated strings.
|
|
identity(x)
Identity function.
|
|
isEmpty(x)
Returns whether an object is empty.
|
|
loadModule(name, join)
Loads a module at runtime.
|
|
loadPlugins(cont)
All content on this website (including text, images, source
code and any other original works), unless otherwise noted,
is licensed under a Creative Commons License.
|
|
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.
|
|
parseDateTime(format, string)
Parses a date and time according to a format string.
|
|
pgettext(context, text)
Translates a string with context
|
|
setLanguage(name)
Changes the current language which is used for all subsequent translations.
|
Field Detail
{String}
expectI18n
Utility function which checks for untranslated strings.
Should be used by widget implementations to convert I18nString to strings
immediately before displaying them.
Defined in: i18n.js.
Defined in: i18n.js.
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.
{I18nString}
noI18n
Converts a string to a translated string without translation.
Use only for user-entered data.
Defined in: i18n.js.
Defined in: i18n.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.
bindtextdomain(domain, pattern)
Adds a new i18n domain, usually for a plugin.
Defined in: i18n.js.
Defined in: i18n.js.
- Parameters:
- {String} domain
- A new domain name, usually the plugin name.
- {String} pattern
- A Pattern which is used to find the PO or JS file on the server. The pattern is processed by formatting it with the language ID as the only parameter. The formatted result is used to download the file from the server.
callback()
Defined in: i18n.js.
{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.
{I18nString}
dnpgettext(domain, context, singular, plural, n)
Translates a string containing numbers.
Defined in: i18n.js.
Defined in: i18n.js.
- Parameters:
- {String} domain
- An i18n domain to use for the translation.
- {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}
dpgettext(domain, context, text)
Translates a string
Defined in: i18n.js.
Defined in: i18n.js.
- Parameters:
- {String} domain
- An i18n domain to use for the translation.
- {String} context
- A context to differentiate multiple identical texts with different translations.
- {String} text
- The original English text to translate.
- Returns:
- The translated text.
emptyFunction()
Empty function. Does nothing.
Defined in: util.js.
Defined in: util.js.
{String}
escapeHTML(s)
Escapes a string to be included in an HTML file.
The characters '<', '>', '&', '"' and "'" are replaced by their HTML entity
references.
Defined in: util.js.
Defined in: util.js.
- Parameters:
- {String} s
- The string to escape.
- Returns:
- The escaped string.
{String}
escapeRegExp(s)
Escapes a string to be included in a regular expression.
Defined in: util.js.
Defined in: util.js.
- Parameters:
- {String} s
- The string to escape.
- Returns:
- The escaped string.
{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.
{String or 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:
- {String or I18nString} string
- The format string.
- params
- Either an array with parameters or multiple separate parameters.
- Returns:
- The formatted string.
{String}
formatDateTime(format, date)
Formats a Date object according to a format string.
Defined in: i18n.js.
Defined in: i18n.js.
- Parameters:
- {String} format
- The format string. It has the same syntax as Java's java.text.SimpleDateFormat, assuming a Gregorian calendar.
- {Date} date
- The Date object to format. It must contain a Time value as defined in the HTTP API specification.
- Returns:
- The formatted date and/or time.
{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).
- Returns:
- The formatted interval.
getKeyDayOfWeek(d)
Returns the day of the week which decides the week number
Defined in: i18n.js.
Defined in: i18n.js.
- Parameters:
- d
- Returns:
- Day of week
{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.
I18nString(toString)
A class for translated strings.
Each I18n object has a toString() method which returns the translation based
on the current language. All user-visible widgets expect instances of this
class, and convert them to strings when the user changes the GUI language.
Defined in: i18n.js.
Defined in: i18n.js.
- Parameters:
- {function()} toString
- A callback function which returns a translated text using the current GUI language.
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, join)
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.
- {Join} join
- An optional Join object which is locked until the module finishes loading.
loadPlugins(cont)
All content on this website (including text, images, source
code and any other original works), unless otherwise noted,
is licensed under a Creative Commons License.
http://creativecommons.org/licenses/by-nc-sa/2.5/
Copyright (C) 2004-2010 Open-Xchange, Inc.
Mail: info@open-xchange.com
Defined in: modules.js.
Author: Viktor Pracht.
Defined in: modules.js.
Author: Viktor Pracht
- Parameters:
- cont
{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.
{Date}
parseDateTime(format, string)
Parses a date and time according to a format string.
Defined in: i18n.js.
Defined in: i18n.js.
- Parameters:
- {String} format
- The format string. It has the same syntax as Java's java.text.SimpleDateFormat, assuming a Gregorian calendar.
- {String} string
- The string to parse.
- Returns:
- The parsed date as a Date object. It will contain a Time value as defined in the HTTP API specification.
{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.
setLanguage(name)
Changes the current language which is used for all subsequent translations.
Also translates all currently displayed strings.
Defined in: i18n.js.
Defined in: i18n.js.
- Parameters:
- {String} name
- The ID of the new language.