bug 1399082 - about:telemetry l10n fixes r?flod draft
authorChris H-C <chutten@mozilla.com>
Tue, 12 Sep 2017 14:12:55 -0400
changeset 664056 91d94923f3b00c7c1c305d256fcd0ef1cb562eba
parent 663134 a73cc4e08bf5a005722c95b43f84ab0c8ff2bc7c
child 731361 279f35f67bd5b9e0f53b85953204c72e36f2f6fa
push id79610
push userbmo:chutten@mozilla.com
push dateWed, 13 Sep 2017 17:34:29 +0000
reviewersflod
bugs1399082
milestone57.0a1
bug 1399082 - about:telemetry l10n fixes r?flod We were reusing "all sections" in more than one way, which isn't a globally- permissable language use. Embedding the substring directly takes care of it while at the same time embedding it within its context. MozReview-Commit-ID: CTQhFWEajRo
toolkit/content/aboutTelemetry.js
toolkit/locales/en-US/chrome/global/aboutTelemetry.properties
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -1419,23 +1419,24 @@ var Search = {
       this.updateNoResults(text, noSearchResults);
     }
     return noSearchResults;
   },
 
   updateNoResults(text, noSearchResults) {
     document.getElementById("no-search-results").classList.toggle("hidden", !noSearchResults);
     if (noSearchResults) {
+      let searchStatus;
       let section = document.querySelector(".category.selected > span");
-      let selectedTitle = section.textContent.trim();
       if (section.parentElement.id === "category-home") {
-        selectedTitle = bundle.GetStringFromName("allSections");
+        searchStatus = bundle.formatStringFromName("noSearchResultsAll", [text], 1);
+      } else {
+        let format = [section.textContent.trim(), text];
+        searchStatus = bundle.formatStringFromName("noSearchResults", format, 2);
       }
-      let format = [selectedTitle, text];
-      let searchStatus = bundle.formatStringFromName("noSearchResults", format, 2);
       document.getElementById("no-search-results-text").textContent = searchStatus;
     }
   },
 
   resetHome() {
     document.getElementById("main").classList.remove("search");
     document.getElementById("no-search-results").classList.add("hidden");
     adjustHeaderState();
@@ -1880,21 +1881,24 @@ function adjustSection() {
     PingPicker._showStructuredPingData();
   }
 }
 
 function adjustHeaderState(title = null) {
   let selected = document.querySelector(".category.selected .category-name");
   let selectedTitle = selected.textContent.trim();
   document.getElementById("sectionTitle").textContent = title ? title : selectedTitle;
+
+  let placeholder;
   if (selected.parentElement.id === "category-home") {
-    selectedTitle = bundle.GetStringFromName("allSections");
+    placeholder = bundle.GetStringFromName("filterAllPlaceholder");
+  } else {
+    placeholder = bundle.formatStringFromName("filterPlaceholder", [ selectedTitle ], 1);
   }
   let search = document.getElementById("search");
-  let placeholder = bundle.formatStringFromName("filterPlaceholder", [ selectedTitle ], 1);
   search.setAttribute("placeholder", placeholder);
 }
 
 /**
  * Change the url according to the current section displayed
  * e.g about:telemetry#general-data
  */
 function changeUrlPath(selectedSection, subSection) {
--- a/toolkit/locales/en-US/chrome/global/aboutTelemetry.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutTelemetry.properties
@@ -46,32 +46,34 @@ currentPingSidebar = current ping
 # - %1$S will be replaced by the current text in the search input
 resultsForSearch = Results for “%1$S”
 
 # Note to translators:
 # - %1$S will be 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 will be replaced by the current text in the search input
 noSearchResults = Sorry! There are no results in %1$S for “%2$S”
 
+# Note to translators:
+# - %S is replaced by the searched terms
+noSearchResultsAll = Sorry! There are no results in any sections for “%S”
+
 telemetryPingTypeAll = all
 
 telemetryLogTitle = Telemetry Log
 
 telemetryLogHeadingId = Id
 
 telemetryLogHeadingTimestamp = Timestamp
 
 telemetryLogHeadingData = Data
 
 # Note to translators:
 # - %1$S will be 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
-
 filterPlaceholder = Find in %1$S
-
-allSections = all sections
+filterAllPlaceholder = Find in all sections
 
 slowSqlMain = Slow SQL Statements on Main Thread
 
 slowSqlOther = Slow SQL Statements on Helper Threads
 
 slowSqlHits = Hits
 
 slowSqlAverage = Avg. Time (ms)