[Pkg-mozext-commits] [firebug] 24/55: Issue 5716: Setting extensions.firebug.useDefaultLocale to true keeps the Cookies panel unlocalized
David Prévot
taffit at moszumanska.debian.org
Mon Mar 31 22:46:09 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag firebug-1.10.1
in repository firebug.
commit 8bcfdc6685d05be095e225151c926490b3b320bd
Author: Jan Odvarko <odvarko at gmail.com>
Date: Thu Jul 19 16:17:59 2012 +0200
Issue 5716: Setting extensions.firebug.useDefaultLocale to true keeps the Cookies panel unlocalized
---
extension/modules/locale.js | 38 +++++++++++++++++++++++++++-----------
1 file changed, 27 insertions(+), 11 deletions(-)
diff --git a/extension/modules/locale.js b/extension/modules/locale.js
index 8e6d2ed..751e914 100644
--- a/extension/modules/locale.js
+++ b/extension/modules/locale.js
@@ -19,8 +19,13 @@ var EXPORTED_SYMBOLS = [];
// console window.
// Cu.import("resource://firebug/fbtrace.js");
+var consoleService = Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService);
+
// Just workaround for this module.
-var FBTrace = {sysout: function(){}};
+var FBTrace = {sysout: function(msg)
+{
+ consoleService.logStringMessage(msg);
+}};
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://firebug/prefLoader.js");
@@ -229,6 +234,10 @@ Locale.registerStringBundle = function(bundleURI)
// Notice that this category entry must not be persistent in Fx 4.0
categoryManager.addCategoryEntry("strings_firebug", bundleURI, "", false, true);
this.stringBundle = null;
+
+ bundleURI = getDefaultStringBundleURI(bundleURI);
+ categoryManager.addCategoryEntry("default_strings_firebug", bundleURI, "", false, true);
+ this.defaultStringBundle = null;
}
Locale.getStringBundle = function()
@@ -241,16 +250,7 @@ Locale.getStringBundle = function()
Locale.getDefaultStringBundle = function()
{
if (!this.defaultStringBundle)
- {
- var chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].
- getService(Ci.nsIChromeRegistry);
-
- var uri = Services.io.newURI("chrome://firebug/locale/firebug.properties", "UTF-8", null);
- var fileURI = chromeRegistry.convertChromeURL(uri).spec;
- var parts = fileURI.split("/");
- parts[parts.length - 2] = DEFAULT_LOCALE;
- this.defaultStringBundle = stringBundleService.createBundle(parts.join("/"));
- }
+ this.defaultStringBundle = stringBundleService.createExtensibleBundle("default_strings_firebug");
return this.defaultStringBundle;
}
@@ -266,3 +266,19 @@ Locale.getPluralRule = function()
}
// ********************************************************************************************* //
+// Helpers
+
+function getDefaultStringBundleURI(bundleURI)
+{
+ var chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].
+ getService(Ci.nsIChromeRegistry);
+
+ var uri = Services.io.newURI(bundleURI, "UTF-8", null);
+ var fileURI = chromeRegistry.convertChromeURL(uri).spec;
+ var parts = fileURI.split("/");
+ parts[parts.length - 2] = DEFAULT_LOCALE;
+
+ return parts.join("/");
+}
+
+// ********************************************************************************************* //
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git
More information about the Pkg-mozext-commits
mailing list