Bug 1399511 - Update message displayed when a section has no data in about:telemetry r?chutten draft
authorFrancesco Lodolo (:flod) <flod@lodolo.net>
Fri, 15 Sep 2017 06:53:33 +0200
changeset 665212 dba152c3bc94cfed2d4a3220c3163933ee145002
parent 665088 8e818b5e9b6bef0fc1a5c527ecf30b0d56a02f14
child 731694 382aba01932c7c4f93d5fa35f07dda5b99da4b31
push id79972
push userbmo:francesco.lodolo@gmail.com
push dateFri, 15 Sep 2017 04:57:20 +0000
reviewerschutten
bugs1399511
milestone57.0a1
Bug 1399511 - Update message displayed when a section has no data in about:telemetry r?chutten MozReview-Commit-ID: 2Hb4oKKlhG7
toolkit/content/aboutTelemetry.js
toolkit/locales/en-US/chrome/global/aboutTelemetry.properties
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -1428,18 +1428,20 @@ var Search = {
   updateNoResults(text, noSearchResults) {
     document.getElementById("no-search-results").classList.toggle("hidden", !noSearchResults);
     if (noSearchResults) {
       let searchStatus;
       let section = document.querySelector(".category.selected > span");
       if (section.parentElement.id === "category-home") {
         searchStatus = bundle.formatStringFromName("noSearchResultsAll", [text], 1);
       } else {
-        let format = [section.textContent.trim(), text];
-        searchStatus = bundle.formatStringFromName("noSearchResults", format, 2);
+        let sectionName = section.textContent.trim();
+        searchStatus = (text === "")
+          ? bundle.formatStringFromName("noDataToDisplay", [sectionName], 1)
+          : bundle.formatStringFromName("noSearchResults", [sectionName, text], 2);
       }
       document.getElementById("no-search-results-text").textContent = searchStatus;
     }
   },
 
   resetHome() {
     document.getElementById("main").classList.remove("search");
     document.getElementById("no-search-results").classList.add("hidden");
old mode 100755
new mode 100644
--- a/toolkit/locales/en-US/chrome/global/aboutTelemetry.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutTelemetry.properties
@@ -42,17 +42,19 @@ filterAllPlaceholder = Find in all secti
 resultsForSearch = Results for “%1$S”
 # LOCALIZATION NOTE(noSearchResults):
 # - %1$S is replaced by the section name from the structure of the ping.
 # More info about it can be found here: https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/telemetry/data/main-ping.html
 # - %2$S is replaced by the current text in the search input
 noSearchResults = Sorry! There are no results in %1$S for “%2$S”
 # LOCALIZATION NOTE(noSearchResultsAll): %S is replaced by the searched terms
 noSearchResultsAll = Sorry! There are no results in any sections for “%S”
-
+# LOCALIZATION NOTE(noDataToDisplay): %S is replaced by the section name.
+# This message is displayed when a section is empty.
+noDataToDisplay = Sorry! There is currently no data available in “%S”
 # LOCALIZATION NOTE(currentPingSidebar): used as a tooltip for the “current”
 # ping title in the sidebar
 currentPingSidebar = current ping
 # LOCALIZATION NOTE(telemetryPingTypeAll): used in the “Ping Type” select
 telemetryPingTypeAll = all
 
 # LOCALIZATION NOTE(histogram*): these strings are used in the “Histograms” section
 histogramSamples = samples