Visit Mozilla.org

XUL:stringbundle

From MDC

« XUL Reference home    [ Examples | Attributes | Properties | Methods | Related ]

An element which can be used to load localized resources from property files. Stringbundles should be placed inside a stringbundleset element.

A property file is a list of property key-value pairs each on a separate line. The key and value is separated with an equals sign. For example, the following defines two properties:

message.displayError=An error occured trying to display this message
message.nameAlreadyUsed=The name %S is already being used by another account.

More information is available in the XUL tutorial.

Attributes
src
Properties
appLocale Obsolete, src, stringBundle, strings
Methods
getFormattedString, getString

[edit] Examples

(example needed)

[edit] Attributes

src
Type: string properties file URL
The URL of the property file that contains the localized strings.

Inherited from XUL element
align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width

[edit] Properties

Inherited from XUL element
align, allowEvents, boxObject, builder, className, collapsed, contextMenu, controllers, currentItem, database, datasources, dir, flex, height, hidden, id, left, listBoxObject, maxHeight, maxWidth, menu, minHeight, minWidth, observes, ordinal, orient, pack, persist, ref, resource, statusText, style, tooltip, tooltipText, top, value, width

Inherited from DOM element
attributes, childNodes, cloneNode, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, tagName

appLocale Obsolete
Type: nsILocale
Returns the XPCOM object which holds information about the user's locale. This is an object which implements nsILocale.

Gecko 1.9.1 note

This property was removed in Gecko 1.9.1.


src
Type: URL
Gets and sets the value of the src attribute.

stringBundle
Type: nsIStringBundle
Returns the XPCOM string bundle object which implements nsIStringBundle.

strings
Type: nsISimpleEnumerator
An enumeration of all of the strings in the string bundle. The enumeration contains nsIPropertyElement objects.

[edit] Methods

getFormattedString( key, strArray )
Return type: 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.

getString( key )
Return type: string
Returns the string with the given key name from the string bundle.

Inherited from XUL element
blur, click, doCommand, focus, getElementsByAttribute

Inherited from DOM element
addEventListener, appendChild, dispatchEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeEventListener, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS

[edit] Related

TBD