Javascript source for the string utility services. More...
Go to the source code of this file.
Functions | |
function | SBString (aKey, aDefault, aStringBundle) |
function | SBBrandedString (aKey, aDefault, aStringBundle) |
function | SBFormattedString (aKey, aParams, aDefault, aStringBundle) |
function | SBBrandedFormattedString (aKey, aParams, aDefault, aStringBundle) |
function | SBFormattedCountString (aKeyBase, aCount, aParams, aDefault, aStringBundle) |
function | SBStringBrandShortName () |
function | SBStringGetDefaultBundle () |
function | SBStringGetBrandBundle () |
function | SBStringBundle (aBundle) |
Variables | |
EXPORTED_SYMBOLS | |
const | Cc = Components.classes |
const | Ci = Components.interfaces |
const | Cr |
var | gSBStringBrandBundle = null |
SBStringBundle | prototype |
var | StringSet |
Javascript source for the string utility services.
Definition in file StringUtils.jsm.
function SBBrandedFormattedString | ( | aKey, | |
aParams, | |||
aDefault, | |||
aStringBundle | |||
) |
Get the branded, formatted localized string with the key specified by aKey using the format parameters specified by aParams and the string bundle specified by aStringBundle. If the string cannot be found, return the default string specified by aDefault; if aDefault is not specified, return aKey. If no string bundle is specified, get the string from the Songbird bundle. If a string cannot be found, return aKey. The brand short name string will be appended to the formatted string parameter list.
aKey | Localized string key. |
aParams | Format params array. |
aStringBundle | Optional string bundle. |
aDefault | Optional default string. |
Definition at line 190 of file StringUtils.jsm.
function SBBrandedString | ( | aKey, | |
aDefault, | |||
aStringBundle | |||
) |
Get and return the localized, branded string with the bundle key specified by aKey using the string bundle specified by aStringBundle. If the string cannot be found, return the string specified by aDefault; if aDefault is not specified, return aKey. If aStringBundle is not specified, use the main Songbird string bundle. The bundle string will be treated as a formatted string, and the first parameter will be set to the brand short name string.
aKey | String bundle key. |
aDefault | Default string value. |
aStringBundle | Optional string bundle. |
Definition at line 128 of file StringUtils.jsm.
function SBFormattedCountString | ( | aKeyBase, | |
aCount, | |||
aParams, | |||
aDefault, | |||
aStringBundle | |||
) |
Get and return the formatted localized count string with the key base specified by aKeyBase using the count specified by aCount. If the count is one, get the string using the singular string key; otherwise, get the formatted string using the plural string key and count. The singular string key is the key base with the suffix "_1". The plural string key is the key base with the suffix "_n". Use the format parameters specified by aParams. If aParams is not specified, use the count as the single format parameter. Use the string bundle specified by aStringBundle. If the string bundle is not specified, use the main Songbird string bundle. If the string cannot be found, return the default string specified by aDefault; if aDefault is not specified or is null, return aKeyBase.
aKeyBase | Localized string key base. |
aCount | Count value for string. |
aParams | Format params array. |
aDefault | Optional default string. |
aStringBundle | Optional string bundle. |
Definition at line 221 of file StringUtils.jsm.
function SBFormattedString | ( | aKey, | |
aParams, | |||
aDefault, | |||
aStringBundle | |||
) |
Get the formatted localized string with the key specified by aKey using the format parameters specified by aParams and the string bundle specified by aStringBundle. If the string cannot be found, return the default string specified by aDefault; if aDefault is not specified or is null, return aKey. If no string bundle is specified, get the string from the Songbird bundle. If a string cannot be found, return aKey.
aKey | Localized string key. |
aParams | Format params array. |
aDefault | Optional default string. |
aStringBundle | Optional string bundle. |
Definition at line 152 of file StringUtils.jsm.
function SBString | ( | aKey, | |
aDefault, | |||
aStringBundle | |||
) |
Get and return the localized string with the key specified by aKey using the string bundle specified by aStringBundle. If the string cannot be found, return the default string specified by aDefault; if aDefault is not specified or is null, return aKey. If aStringBundle is not specified, use the main Songbird string bundle.
aKey | Localized string key. |
aDefault | Optional default string. |
aStringBundle | Optional string bundle. |
Definition at line 93 of file StringUtils.jsm.
function SBStringBrandShortName | ( | ) |
Return the Songbird brand short name localized string.
Definition at line 268 of file StringUtils.jsm.
function SBStringBundle | ( | aBundle | ) |
Construct a Songbird string bundle utility object using the base string bundle specified by aBundle. If aBundle is a string, it is treated as a URI for a string bundle; otherwise, it is treated as a string bundle object. If aBundle is not specified, the default Songbird string bundle is used.
==> aBundle Base string bundle.
Definition at line 349 of file StringUtils.jsm.
function SBStringGetBrandBundle | ( | ) |
Return the Songbird branding localized string bundle.
Definition at line 299 of file StringUtils.jsm.
function SBStringGetDefaultBundle | ( | ) |
Return the default Songbird string bundle utility object.
Definition at line 285 of file StringUtils.jsm.
const Cc = Components.classes |
Definition at line 58 of file StringUtils.jsm.
const Ci = Components.interfaces |
Definition at line 59 of file StringUtils.jsm.
const Cr |
Definition at line 60 of file StringUtils.jsm.
EXPORTED_SYMBOLS |
Definition at line 40 of file StringUtils.jsm.
var gSBStringBrandBundle = null |
Definition at line 70 of file StringUtils.jsm.
SBStringBundle prototype |
Definition at line 367 of file StringUtils.jsm.
var StringSet |
Definition at line 580 of file StringUtils.jsm.