Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

stringbundle

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

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

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

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

"src" 属性は chrome:// の絶対 URL のみを受け入れます。(参照バグ 133698, 26291)
属性
src
プロパティ
appLocale , src, stringBundle, strings
メソッド
getFormattedString, getString

(例が必要)

属性

src
型: 文字列型の properties ファイルの 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

プロパティ

appLocale
型: nsILocale
ユーザのロケールについての情報を保持する XPCOM オブジェクトを返す。これは nsILocale を実装するオブジェクトです。
src
型: URL
src 属性の値の取得と設定。
stringBundle
型: nsIStringBundle
nsIStringBundle を実装する XPCOM string bundle オブジェクトを返す。
strings
型: nsISimpleEnumerator
すべての string bundle 内の文字列を列挙したもの。これらは nsIPropertyElement オブジェクトを含みます。

メソッド

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

関連項目

TBD

ドキュメントのタグと貢献者

 このページの貢献者: Marsf
 最終更新者: Marsf,