Bug 1407548- Cache L10N values in request-list-empty-notice; r=gasolin draft Bug-1407548
authorPradeep <pradeepgangwar39@gmail.com>
Thu, 12 Oct 2017 16:36:28 +0530
branchBug-1407548
changeset 679053 d8867d50a9fd5abda02111707fd77d7e799febe0
parent 678523 f3e939a81ee1169f9501ad96eb43bbf4bf4a1bde
child 735529 53bc794d498bc42da23fb1db0784549e1e7bc96a
push id84140
push userbmo:pradeepgangwar39@gmail.com
push dateThu, 12 Oct 2017 11:08:06 +0000
reviewersgasolin
bugs1407548
milestone58.0a1
Bug 1407548- Cache L10N values in request-list-empty-notice; r=gasolin MozReview-Commit-ID: 6V4MNg8LWwS *** Bug 1407548- Cache L10N values in request-list-empty-notice; r=gasolin MozReview-Commit-ID: FfojJJ6uBdI
devtools/client/netmonitor/src/components/request-list-empty-notice.js
--- a/devtools/client/netmonitor/src/components/request-list-empty-notice.js
+++ b/devtools/client/netmonitor/src/components/request-list-empty-notice.js
@@ -17,16 +17,23 @@ const { ACTIVITY_TYPE } = require("../co
 const { L10N } = require("../utils/l10n");
 const { getPerformanceAnalysisURL } = require("../utils/mdn-utils");
 
 // Components
 const MDNLink = createFactory(require("./mdn-link"));
 
 const { button, div, span } = DOM;
 
+const RELOAD_NOTICE_1 = L10N.getStr("netmonitor.reloadNotice1");
+const RELOAD_NOTICE_2 = L10N.getStr("netmonitor.reloadNotice2");
+const RELOAD_NOTICE_3 = L10N.getStr("netmonitor.reloadNotice3");
+const PERFORMANCE_NOTICE_1 = L10N.getStr("netmonitor.perfNotice1");
+const PERFORMANCE_NOTICE_2 = L10N.getStr("netmonitor.perfNotice2");
+const PERFORMANCE_NOTICE_3 = L10N.getStr("netmonitor.perfNotice3");
+
 /**
  * UI displayed when the request list is empty. Contains instructions on reloading
  * the page and on triggering performance analysis of the page.
  */
 const RequestListEmptyNotice = createClass({
   displayName: "RequestListEmptyNotice",
 
   propTypes: {
@@ -35,36 +42,36 @@ const RequestListEmptyNotice = createCla
   },
 
   render() {
     return div(
       {
         className: "request-list-empty-notice",
       },
       div({ className: "notice-reload-message" },
-        span(null, L10N.getStr("netmonitor.reloadNotice1")),
+        span(null, RELOAD_NOTICE_1),
         button(
           {
             className: "devtools-button requests-list-reload-notice-button",
             "data-standalone": true,
             onClick: this.props.onReloadClick,
           },
-          L10N.getStr("netmonitor.reloadNotice2")
+          RELOAD_NOTICE_2
         ),
-        span(null, L10N.getStr("netmonitor.reloadNotice3"))
+        span(null, RELOAD_NOTICE_3)
       ),
       div({ className: "notice-perf-message" },
-        span(null, L10N.getStr("netmonitor.perfNotice1")),
+        span(null, PERFORMANCE_NOTICE_1),
         button({
-          title: L10N.getStr("netmonitor.perfNotice3"),
+          title: PERFORMANCE_NOTICE_3,
           className: "devtools-button requests-list-perf-notice-button",
           "data-standalone": true,
           onClick: this.props.onPerfClick,
         }),
-        span(null, L10N.getStr("netmonitor.perfNotice2")),
+        span(null, PERFORMANCE_NOTICE_2),
         MDNLink({ url: getPerformanceAnalysisURL() })
       )
     );
   }
 });
 
 module.exports = connect(
   undefined,