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
--- 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,