!import
1 <?xml version="1.0"?>
2
3 <bindings id="stringBundleBindings"
4 xmlns="http://www.mozilla.org/xbl"
5 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
6
7 <binding id="stringbundleset" extends="xul:box"/>
8
9 <binding id="stringbundle" extends="xul:spacer">
10 <implementation name="XStringBundle">
11
12 <method name="getString">
13 <parameter name="aStringKey"/>
getString
Called: XULElement:GetStringFromName (25 calls, 4369 v-uS)
XULElement:getService (12 calls, 2211 v-uS)
XULElement:createBundle (6 calls, 149 v-uS)
XULElement:getApplicationLocale (6 calls, 208 v-uS)
XULElement:getAttribute (6 calls, 132 v-uS)
Called By: abCardViewOverlay.js:OnLoadCardView (15 calls, 873 v-uS)
MsgComposeCommands.js:SetComposeWindowTitle (4 calls, 3069 v-uS)
msgAccountCentral.js:OnInit (2 calls, 677 v-uS)
MsgComposeCommands.js:InitLanguageMenu (1 calls, 1341 v-uS)
addressbook.js:SetStatusText (1 calls, 38 v-uS)
mail-offline.js:updateOfflineUI (1 calls, 3031 v-uS)
msgMail3PaneWindow.js:loadFolderViewForTree (1 calls, 365 v-uS)
14 <body>
15 <![CDATA[
16 try {
17 return this.stringBundle.GetStringFromName(aStringKey);
18 }
19 catch (e) {
20 dump("*** Failed to get string " + aStringKey + " in bundle: " + this.src + "\n");
21 throw e;
22 }
23 ]]>
24 </body>
25 </method>
26
27 <method name="getFormattedString">
28 <parameter name="aStringKey"/>
29 <parameter name="aStringsArray"/>
getFormattedString
Called: XULElement:formatStringFromName (1 calls, 24 v-uS)
Called By: msgAccountCentral.js:OnInit (1 calls, 56 v-uS)
30 <body>
31 <![CDATA[
32 try {
33 return this.stringBundle.formatStringFromName(aStringKey, aStringsArray, aStringsArray.length);
34 }
35 catch (e) {
36 dump("*** Failed to format string " + aStringKey + " in bundle: " + this.src + "\n");
37 throw e;
38 }
39 ]]>
40 </body>
41 </method>
42
43 <property name="stringBundle" readonly="true">
get_stringBundle
44 <getter>
45 <![CDATA[
46 if (!this._bundle) {
47 try {
48 var stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]
49 .getService(Components.interfaces.nsIStringBundleService);
50 this._bundle = stringBundleService.createBundle(this.src, this.appLocale);
51 }
52 catch (e) {
53 dump("Failed to get stringbundle:\n");
54 dump(e + "\n");
55 }
56 }
57 return this._bundle;
58 ]]>
59 </getter>
60 </property>
61
62 <property name="src">
get_src
63 <getter>
64 <![CDATA[
65 return this.getAttribute("src");
66 ]]>
67 </getter>
set_src
68 <setter>
69 <![CDATA[
70 this._bundle = null;
71 this.setAttribute("src", val);
72 return val;
73 ]]>
74 </setter>
75 </property>
76
77 <property name="appLocale">
get_appLocale
78 <getter>
79 <![CDATA[
80 try {
81 var localeService = Components.classes["@mozilla.org/intl/nslocaleservice;1"]
82 .getService(Components.interfaces.nsILocaleService);
83 return localeService.getApplicationLocale();
84 }
85 catch (ex) {
86 return null;
87 }
88 ]]>
89 </getter>
90 </property>
91
92 <property name="strings">
get_strings
93 <getter>
94 <![CDATA[
95 // Note: this is a sucky method name! Should be:
96 // readonly attribute nsISimpleEnumerator strings;
97 return this.stringBundle.getSimpleEnumeration();
98 ]]>
99 </getter>
100 </property>
101
field__bundle
102 <field name="_bundle">null</field>
103
104 </implementation>
105 </binding>
106
107 </bindings>