Bug 1489419 - Add i18n for DebugTargetList component;
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 24 Sep 2018 09:44:48 +0000
changeset 493603 7ef4181be633e3e9a1aeefe0f62fe27987ac4ebc
parent 493602 96a50ee44a84303f7b6d959970b96d66a2643d67
child 493604 e1172468e666bd16dfcf5fbf19642a3e70248ba0
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1489419
milestone64.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 1489419 - Add i18n for DebugTargetList component; Depends on D6606 Differential Revision: https://phabricator.services.mozilla.com/D6607
devtools/client/aboutdebugging-new/src/components/debugtarget/DebugTargetList.js
devtools/client/aboutdebugging-new/tmp-locale/en-US/aboutdebugging.notftl
--- a/devtools/client/aboutdebugging-new/src/components/debugtarget/DebugTargetList.js
+++ b/devtools/client/aboutdebugging-new/src/components/debugtarget/DebugTargetList.js
@@ -4,16 +4,19 @@
 
 "use strict";
 
 const { createFactory, createRef, PureComponent } =
   require("devtools/client/shared/vendor/react");
 const dom = require("devtools/client/shared/vendor/react-dom-factories");
 const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
 
+const FluentReact = require("devtools/client/shared/vendor/fluent-react");
+const Localized = createFactory(FluentReact.Localized);
+
 const DebugTargetItem = createFactory(require("./DebugTargetItem"));
 
 /**
  * This component displays list of debug target.
  */
 class DebugTargetList extends PureComponent {
   static get propTypes() {
     return {
@@ -43,32 +46,44 @@ class DebugTargetList extends PureCompon
   getSnapshotBeforeUpdate(prevProps) {
     if (this.props.isCollapsed !== prevProps.isCollapsed) {
       return this.listRef.current.clientHeight;
     }
 
     return null;
   }
 
+  renderEmptyList() {
+    return Localized(
+      {
+        id: "about-debugging-debug-target-list-empty"
+      },
+      dom.span(
+        {},
+        "Nothing yet."
+      )
+    );
+  }
+
   render() {
     const {
       actionComponent,
       detailComponent,
       dispatch,
       isCollapsed,
       targets,
     } = this.props;
 
     return dom.ul(
       {
         className: "debug-target-list js-debug-target-list" +
                    (isCollapsed ? " debug-target-list--collapsed" : ""),
         ref: this.listRef,
       },
       targets.length === 0
-        ? "Nothing yet."
+        ? this.renderEmptyList()
         : targets.map((target, key) =>
             DebugTargetItem({ actionComponent, detailComponent, dispatch, key, target })),
     );
   }
 }
 
 module.exports = DebugTargetList;
--- a/devtools/client/aboutdebugging-new/tmp-locale/en-US/aboutdebugging.notftl
+++ b/devtools/client/aboutdebugging-new/tmp-locale/en-US/aboutdebugging.notftl
@@ -26,16 +26,20 @@ about-debugging-runtime-extensions = Ext
 about-debugging-runtime-tabs = Tabs
 # Title of the service workers category.
 about-debugging-runtime-service-workers = Service Workers
 # Title of the shared workers category.
 about-debugging-runtime-shared-workers = Shared Workers
 # Title of the other workers category.
 about-debugging-runtime-other-workers = Other Workers
 
+# Displayed in the categories of "runtime" pages that don't have any debug target to
+# show. Debug targets depend on the category (extensions, tabs, workers...).
+about-debugging-debug-target-list-empty = Nothing yet.
+
 # Text of a button displayed in the "This Firefox" page, in the Temporary Extension
 # section. Clicking on the button will open a file picker to load a temporary extension
 about-debugging-tmp-extension-install-button = Load Temporary Add-on…
 
 # Text of a button displayed for a temporary extension loaded in the "This Firefox" page.
 # Clicking on the button will reload the extension.
 about-debugging-tmp-extension-reload-button = Reload