StringUtils.jsm File Reference

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
 

Detailed Description

Javascript source for the string utility services.

Definition in file StringUtils.jsm.

Function Documentation

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.

Parameters
aKeyLocalized string key.
aParamsFormat params array.
aStringBundleOptional string bundle.
aDefaultOptional default string.
Returns
Localized string.

Definition at line 190 of file StringUtils.jsm.

Here is the call graph for this function:

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.

Parameters
aKeyString bundle key.
aDefaultDefault string value.
aStringBundleOptional string bundle.
Returns
Localized string.

Definition at line 128 of file StringUtils.jsm.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
aKeyBaseLocalized string key base.
aCountCount value for string.
aParamsFormat params array.
aDefaultOptional default string.
aStringBundleOptional string bundle.
Returns
Localized string.

Definition at line 221 of file StringUtils.jsm.

Here is the call graph for this function:

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.

Parameters
aKeyLocalized string key.
aParamsFormat params array.
aDefaultOptional default string.
aStringBundleOptional string bundle.
Returns
Localized string.

Definition at line 152 of file StringUtils.jsm.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
aKeyLocalized string key.
aDefaultOptional default string.
aStringBundleOptional string bundle.
Returns
Localized string.

Definition at line 93 of file StringUtils.jsm.

Here is the call graph for this function:

Here is the caller graph for this function:

function SBStringBrandShortName ( )

Return the Songbird brand short name localized string.

Returns
Songbird brand short name.

Definition at line 268 of file StringUtils.jsm.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

function SBStringGetBrandBundle ( )

Return the Songbird branding localized string bundle.

Returns
Songbird branding localized string bundle.

Definition at line 299 of file StringUtils.jsm.

Here is the caller graph for this function:

function SBStringGetDefaultBundle ( )

Return the default Songbird string bundle utility object.

Returns
Default Songbird string bundle utility object.

Definition at line 285 of file StringUtils.jsm.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const Cc = Components.classes

Definition at line 58 of file StringUtils.jsm.

Definition at line 59 of file StringUtils.jsm.

const Cr
Initial value:
= Components.results
var gSBStringDefaultBundle = null
return null
Definition: FeedWriter.js:1143

Definition at line 60 of file StringUtils.jsm.

EXPORTED_SYMBOLS
Initial value:
= [ "SBString",
"SBBrandedString",
"SBFormattedString",
"SBBrandedFormattedString",
"SBFormattedCountString",
"SBStringBrandShortName",
"SBStringGetDefaultBundle",
"SBStringGetBrandBundle",
"SBStringBundle",
"StringSet" ]

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.