Bug 1485901 - Don't add aboutdebugging locale source if it has already been added; r=jdescottes
authorBrian Birtles <birtles@gmail.com>
Fri, 31 Aug 2018 08:35:33 +0000
changeset 434399 dcae3a9fe7b749da82836763c97968052d8f12e3
parent 434398 5ebac82b70a5d219a4106197a3b95b7bef8caee1
child 434400 54a320057b31208111ac08818b69c694ff26cb46
child 434422 2667224d61d0242a29bfe2e442387a92cc58bc16
push id68640
push userbbirtles@mozilla.com
push dateSat, 01 Sep 2018 04:39:58 +0000
treeherderautoland@dcae3a9fe7b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1485901
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1485901 - Don't add aboutdebugging locale source if it has already been added; r=jdescottes Differential Revision: https://phabricator.services.mozilla.com/D4745
devtools/client/aboutdebugging-new/aboutdebugging.js
--- a/devtools/client/aboutdebugging-new/aboutdebugging.js
+++ b/devtools/client/aboutdebugging-new/aboutdebugging.js
@@ -56,22 +56,24 @@ const AboutDebugging = {
       this.actions.updateNetworkLocations(getNetworkLocations());
     });
   },
 
   async createMessageContexts() {
     // XXX Until the strings for the updated about:debugging stabilize, we
     // locate them outside the regular directory for locale resources so that
     // they don't get picked up by localization tools.
-    const temporarySource = new FileSource(
-      "aboutdebugging",
-      ["en-US"],
-      "chrome://devtools/content/aboutdebugging-new/tmp-locale/{locale}/"
-    );
-    L10nRegistry.registerSource(temporarySource);
+    if (!L10nRegistry.sources.has("aboutdebugging")) {
+      const temporarySource = new FileSource(
+        "aboutdebugging",
+        ["en-US"],
+        "chrome://devtools/content/aboutdebugging-new/tmp-locale/{locale}/"
+      );
+      L10nRegistry.registerSource(temporarySource);
+    }
 
     const locales = Services.locale.getAppLocalesAsBCP47();
     const generator =
       L10nRegistry.generateContexts(locales, ["aboutdebugging.ftl"]);
 
     const contexts = [];
     for await (const context of generator) {
       contexts.push(context);