michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: var strBundleService = null; michael@0: michael@0: function srGetStrBundle(path) michael@0: { michael@0: var strBundle = null; michael@0: michael@0: if (!strBundleService) { michael@0: try { michael@0: strBundleService = michael@0: Components.classes["@mozilla.org/intl/stringbundle;1"].getService(); michael@0: strBundleService = michael@0: strBundleService.QueryInterface(Components.interfaces.nsIStringBundleService); michael@0: } catch (ex) { michael@0: dump("\n--** strBundleService failed: " + ex + "\n"); michael@0: return null; michael@0: } michael@0: } michael@0: michael@0: strBundle = strBundleService.createBundle(path); michael@0: if (!strBundle) { michael@0: dump("\n--** strBundle createInstance failed **--\n"); michael@0: } michael@0: return strBundle; michael@0: }