Bug 1399511 - Update message displayed when a section has no data in about:telemetry r=chutten
authorFrancesco Lodolo (:flod) <flod@lodolo.net>
Fri, 15 Sep 2017 06:53:33 +0200
changeset 665682 8998495d56dcb03aac5376b72ccd73ab19dbfc8c
parent 665681 f73a6867afeead095c1804adb63815fb885af2f3
child 665683 18dad63ef0c67b7bc0e8afb4c1268d5d6c30a55b
push id80148
push userbmo:emilio@crisal.io
push dateFri, 15 Sep 2017 20:59:22 +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