MessageManager.getMsgFrom Member
Syntax
object.getMsgFrom(bundle, msgName, params, deflt);
Arguments
Argument | Summary |
---|---|
bundle | |
msgName | |
params | |
deflt |
Returns
Remarks
See Also
Source Code
function mm_getfrom (bundle, msgName, params, deflt)
{
var me = this;
function replaceEntities(matched, entity)
{
if (entity in me.entities)
return me.entities[entity];
return matched;
};
try
{
var rv;
if (params && isinstance(params, Array))
rv = bundle.formatStringFromName (msgName, params, params.length);
else if (params || params == 0)
rv = bundle.formatStringFromName (msgName, [params], 1);
else
rv = bundle.GetStringFromName (msgName);
/* strip leading and trailing quote characters, see comment at the
* top of venkman.properties.
*/
rv = rv.replace(/^\"/, "");
rv = rv.replace(/\"$/, "");
rv = rv.replace(/\&(\w+)\;/g, replaceEntities);
return rv;
}
catch (ex)
{
if (typeof deflt == "undefined")
{
ASSERT (0, "caught exception getting value for ``" + msgName +
"''\n" + ex + "\n");
return msgName;
}
return deflt;
}
return null;
}