mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 06:35:42 +00:00
29 lines
843 B
JavaScript
29 lines
843 B
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
var strBundleService = null;
|
|
|
|
function srGetStrBundle(path)
|
|
{
|
|
var strBundle = null;
|
|
|
|
if (!strBundleService) {
|
|
try {
|
|
strBundleService =
|
|
Components.classes["@mozilla.org/intl/stringbundle;1"].getService();
|
|
strBundleService =
|
|
strBundleService.QueryInterface(Components.interfaces.nsIStringBundleService);
|
|
} catch (ex) {
|
|
dump("\n--** strBundleService failed: " + ex + "\n");
|
|
return null;
|
|
}
|
|
}
|
|
|
|
strBundle = strBundleService.createBundle(path);
|
|
if (!strBundle) {
|
|
dump("\n--** strBundle createInstance failed **--\n");
|
|
}
|
|
return strBundle;
|
|
}
|