diff options
author | Rogan Creswick <creswick@galois.com> | 2012-03-31 08:08:11 -0700 |
---|---|---|
committer | Rogan Creswick <creswick@galois.com> | 2012-03-31 08:08:11 -0700 |
commit | ec532e93339a942a395829ec87f427852cd72e00 (patch) | |
tree | f6ad13ca7f90f26fda9bc23e428ee367f153e3d2 /tools/addon-sdk-1.4/packages/api-utils/docs/app-strings.md | |
parent | 780bf48de85215f5b0b6fde0df40599ac6f9c037 (diff) |
removed older addon-sdks from tools
Diffstat (limited to 'tools/addon-sdk-1.4/packages/api-utils/docs/app-strings.md')
-rw-r--r-- | tools/addon-sdk-1.4/packages/api-utils/docs/app-strings.md | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/tools/addon-sdk-1.4/packages/api-utils/docs/app-strings.md b/tools/addon-sdk-1.4/packages/api-utils/docs/app-strings.md deleted file mode 100644 index 3e4d358..0000000 --- a/tools/addon-sdk-1.4/packages/api-utils/docs/app-strings.md +++ /dev/null @@ -1,61 +0,0 @@ -The `app-strings` module gives you access to the host application's localized -string bundles (`.properties` files). - -The module exports the `StringBundle` constructor function. To access a string -bundle, construct an instance of `StringBundle`, passing it the bundle's URL: - - var StringBundle = require("app-strings").StringBundle; - var bundle = StringBundle("chrome://browser/locale/browser.properties"); - -To get the value of a string, call the object's `get` method, passing it -the name of the string: - - var accessKey = bundle.get("contextMenuSearchText.accesskey"); - // "S" in the en-US locale - -To get the formatted value of a string that accepts arguments, call the object's -`get` method, passing it the name of the string and an array of arguments -with which to format the string: - - var searchText = bundle.get("contextMenuSearchText", - ["universe", "signs of intelligent life"]); - // 'Search universe for "signs of intelligent life"' in the en-US locale - -To get all strings in the bundle, iterate the object, which returns arrays -of the form [name, value]: - - for (var [name, value] in Iterator(bundle)) - console.log(name + " = " + value); - -Iteration ---------- - -<code>for (var name in bundle) { ... }</code> - -Iterate the names of strings in the bundle. - -<code>for each (var val in bundle) { ... }</code> - -Iterate the values of strings in the bundle. - -<code>for (var [name, value] in Iterator(bundle)) { ... }</code> - -Iterate the names and values of strings in the bundle. - - -<api name="StringBundle"> -@class -The `StringBundle` object represents a string bundle. -<api name="StringBundle"> -@constructor -Creates a StringBundle object that gives you access to a string bundle. -@param url {string} the URL of the string bundle -@returns {StringBundle} the string bundle -</api> -<api name="get"> -@method Get the value of the string with the given name. -@param [name] {string} the name of the string to get -@param [args] {array} (optional) strings that replace placeholders in the string -@returns {string} the value of the string -</api> -</api> |