nsISupports
Last changed in Gecko 1.7 This interface is used by XUL:stringbundle
to retrieve strings. It is recommended that you use the methods of XUL:stringbundle
to access these functions unless necessary. Alternatively, a string bundle can be created within a javascript context with nsIStringBundleService
.
wstring formatStringFromID(in long aID, [array, size_is(length)] in wstring params, in unsigned long length); |
wstring formatStringFromName(in wstring aName, [array, size_is(length)] in wstring params, in unsigned long length); |
nsISimpleEnumerator getSimpleEnumeration(); |
wstring GetStringFromID(in long aID); |
wstring GetStringFromName(in wstring aName); |
Returns a formatted string with the given ID from the string bundle, where each occurrence of %S
(uppercase) is replaced by each successive element in the supplied array. You may also use other formatting codes. You can only pass Unicode strings in. The ID should refer to a string in the bundle that uses %S, and the number of strings you pass MUST be the same here and in the properties file (That is you can't omit %1 and use only %2)
. Do NOT try to use any other types. This uses nsTextFormatter::smprintf
.
wstring formatStringFromID( in long aID, [array, size_is(length)] in wstring params, in unsigned long length );
aID
params
length
Returns the formatted string.
Returns a formatted string with the given key name from the string bundle, where each occurrence of %S
(uppercase) is replaced by each successive element in the supplied array. You may also use other formatting codes, but can only pass Unicode strings in. The name should refer to a string in the bundle that uses %S
, and the number of strings you pass MUST be the same here and in the properties file (That is you can't omit %1
and use only %2
). Do NOT try to use any other types. This uses nsTextFormatter::smprintf
to do the dirty work.
wstring formatStringFromName( in wstring aName, [array, size_is(length)] in wstring params, in unsigned long length );
aName
params
length
Returns the formatted string.
nsISimpleEnumerator getSimpleEnumeration();
None.
Returns a nsISimpleEnumerator
of all nsIPropertyElement
entries in the string bundle.
Retrieves a string from the bundle by its ID.
wstring GetStringFromID( in long aID );
aID
Returns the requested string.
Retrieves a string from the bundle by its name.
wstring GetStringFromName( in wstring aName );
aName
Returns the requested string.