Namespace idx.resources
Provides functionality for overriding and obtaining resource bundles in a hierarchal
manner so that resources can be defined globally, at the package level, and at the module
level with each more specific level taking greater precedence. Functions in this namespace
typically refer to a "resource scope". The scope looks like a module path for Dojo such
as "idx/layout/HeaderPane". In order to build the resources for "idx/layout/HeaderPane"
scope we get the merger of of the following dojo/i18n NLS files:
- idx/nls/base.js
- idx/layout/nls/base.js
- idx/layout/nls/HeaderPane.js
Defined in: <idx\resources.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
Method Summary
Method Attributes | Method Name and Description |
---|---|
<static> |
idx.resources.clearLocalOverrides(locale)
|
<static> |
idx.resources.clearOverrides()
Clears all resource overrides for all locales.
|
<static> |
idx.resources.get(name, scope, locale)
Gets the named resource in the specified scope.
|
<static> |
idx.resources.getCurrencyFormatOptions(scope, locale)
Getter for currency format options
|
<static> |
idx.resources.getDateFormatOptions(scope, locale)
Getter for date format options
|
<static> |
idx.resources.getDateTimeFormatOptions(scope, locale)
Getter for date/time format options
|
<static> |
idx.resources.getDecimalFormatOptions(scope, locale)
Getter for date format options
|
<static> |
idx.resources.getDependencies(scope)
Obtains the array of "dojo/i18n!" dependencies for the specified scope.
|
<static> |
idx.resources.getIntegerFormatOptions(scope, locale)
Getter for integer format options
|
<static> |
idx.resources.getLabelFieldSeparator()
Returns the resource to use for separating labels from their fields.
|
<static> |
idx.resources.getPercentFormatOptions(scope, locale)
Getter for percent format options
|
<static> |
idx.resources.getResources(scope, locale)
Obtains the resources for the specified scope.
|
<static> |
idx.resources.getTimeFormatOptions(scope, locale)
Getter for time format options
|
<static> |
idx.resources.install(resources, scope, locale)
Installs new resources and/or overrides existing resources being either in
the base resource scope or in a specified scope.
|
Method Detail
<static> idx.resources.clearLocalOverrides(locale)
- Parameters:
- {String} locale
- The optional locale for which the overrides should be cleared. If not specified then the default locale is assumed.
<static> idx.resources.clearOverrides()
Clears all resource overrides for all locales.
<static> {String} idx.resources.get(name, scope, locale)
Gets the named resource in the specified scope. If the name is not found
in the specified scope then the parent scope is searched and then its
parent up until the root scope. If the resources is not found then null
is returned. If the scope is not specified then the root scope is assumed.
The locale may be optionally specified as well.
- Parameters:
- {String} name
- The name of the resource to obtain from the hierarchical bundle.
- {String} scope
- The optional scope, if not specified then the global scope is used.
- {String} locale
- The optional locale, if not specified the default locale is used.
- Returns:
- {String} The value for the resource or null if not found.
<static> {Object} idx.resources.getCurrencyFormatOptions(scope, locale)
Getter for currency format options
- Parameters:
- {String} scope
- The optional scope, if not specified then the global scope is assumed.
- {String} locale
- The optional locale, if not specified then the default locale is assumed.
- Returns:
- {Object} The currency format options for the given scope.
<static> {Object} idx.resources.getDateFormatOptions(scope, locale)
Getter for date format options
- Parameters:
- {String} scope
- The optional scope, if not specified then the global scope is assumed.
- {String} locale
- The optional locale, if not specified then the default locale is assumed.
- Returns:
- {Object} The date format options for the given scope.
<static> {Object} idx.resources.getDateTimeFormatOptions(scope, locale)
Getter for date/time format options
- Parameters:
- {String} scope
- The optional scope, if not specified then the global scope is assumed.
- {String} locale
- The optional locale, if not specified then the default locale is assumed.
- Returns:
- {Object} The date/time format options for the given scope.
<static> {Object} idx.resources.getDecimalFormatOptions(scope, locale)
Getter for date format options
- Parameters:
- {String} scope
- The optional scope, if not specified then the global scope is assumed.
- {String} locale
- The optional locale, if not specified then the default locale is assumed.
- Returns:
- {Object} The decimal format options for the given scope.
<static> {String[]} idx.resources.getDependencies(scope)
Obtains the array of "dojo/i18n!" dependencies for the specified scope.
- Parameters:
- {String} scope
- The optional string to override resources in a specific scope. If not specified then the global scope is assumed.
- Returns:
- {String[]} Returns the array of "dojo/i18n!" dependencies.
<static> {Object} idx.resources.getIntegerFormatOptions(scope, locale)
Getter for integer format options
- Parameters:
- {String} scope
- The optional scope, if not specified then the global scope is assumed.
- {String} locale
- The optional locale, if not specified then the default locale is assumed.
- Returns:
- {Object} The integer format options for the given scope.
<static> idx.resources.getLabelFieldSeparator()
Returns the resource to use for separating labels from their fields.
Typically this is a ":" or something to that effect.
- Returns:
- Returns the resource to use for separating labels from their fields. Typically this is a ":" or something to that effect.
<static> {Object} idx.resources.getPercentFormatOptions(scope, locale)
Getter for percent format options
- Parameters:
- {String} scope
- The optional scope, if not specified then the global scope is assumed.
- {String} locale
- The optional locale, if not specified then the default locale is assumed.
- Returns:
- {Object} The percent format options for the given scope.
<static> {Object} idx.resources.getResources(scope, locale)
Obtains the resources for the specified scope. The specified scope
might look like "idx/layout/HeaderPane", "idx/layout" or "ibm/myproduct".
- Parameters:
- {String} scope
- The optional string to override resources in a specific scope. If not specified then the global scope is assumed.
- {String} locale
- The optional locale for which the resources are being requested. If not specified then the default locale is assumed.
- Returns:
- {Object} Returns a flattened resources object containing all resources for the optionally specified scope.
<static> {Object} idx.resources.getTimeFormatOptions(scope, locale)
Getter for time format options
- Parameters:
- {String} scope
- The optional scope, if not specified then the global scope is assumed.
- {String} locale
- The optional locale, if not specified then the default locale is assumed.
- Returns:
- {Object} The time format options for the given scope.
<static> idx.resources.install(resources, scope, locale)
Installs new resources and/or overrides existing resources being either in
the base resource scope or in a specified scope. The specified scope
might look like "idx/layout/HeaderPane", "idx/layout" or "ibm/myproduct".
Resources should only be installed during application startup and then should
be left unchanged to maximize efficiency.
- Parameters:
- {Object} resources
- The new resources to override the old ones -- this is mixed in as a layer on top of the default resources.
- {String} scope
- The optional string to override resources in a specific scope. If not specified then the global scope is assumed.
- {String} locale
- The optional locale to override for. If not specified then the default locale is assumed.