Visit Mozilla.org

XUL:stringbundle

出典: MDC

« XUL リファレンス HOME    [ | 属性 | プロパティ | メソッド | 関連項目 ]

ローカライズされたリソースをプロパティファイルから読み込むために使用する要素。stringbundle は stringbundleset 要素の中に置かれなければなりません。

プロパティファイルは、プロパティのキーと値の組が各行に書かれたリストです。キーおよび値は等号('=') で区切られます。次の例は二つのプロパティを定義しています:

message.displayError=このメッセージを表示しようとしてエラーが発生しました
message.nameAlreadyUsed=アカウント名 %S はすでに他のアカウントで使用されています。

詳しい情報が XUL チュートリアルにあります。

属性
src
プロパティ
appLocale, src, stringBundle, strings
メソッド
getFormattedString, getString

[編集]

(例が必要)

[編集] 属性

src
型: string properties file URL
ローカライズされた文字列を含む property ファイルの URL。

XUL 要素からの継承
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

[編集] プロパティ

XUL 要素からの継承
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

DOM 要素からの継承
attributes, childNodes, cloneNode, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, tagName

appLocale
型: nsILocale
ユーザのロケールについての情報を保持する XPCOM オブジェクトを返す。これは nsILocale を実装するオブジェクトです。

src
型: URL
src 属性の値の取得と設定。

stringBundle
型: nsIStringBundle
nsIStringBundle を実装する XPCOM string bundle オブジェクトを返す。

strings
型: nsISimpleEnumerator
すべての string bundle 内の文字列を列挙したもの。これらは nsIPropertyElement オブジェクトを含みます。

[編集] メソッド

getFormattedString( key, strArray )
戻り値の型: string
string bundle から与えられた key 名の、フォーマット済みの文字列を返します。%S (大文字) が現れる場所は、与えられた配列内の連続する各要素に置き換えられます。他の書式コードを使用することもできます。

getString( key )
戻り値の型: string
string bundle から与えられた key 名の文字列を返します。

XUL 要素からの継承
blur, click, doCommand, focus, getElementsByAttribute

DOM 要素からの継承
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

[編集] 関連項目

TBD