bug 1399082 - about:telemetry l10n fixes r=flod
☠☠ backed out by e392e524801b ☠ ☠
authorChris H-C <chutten@mozilla.com>
Tue, 12 Sep 2017 14:12:55 -0400
changeset 430079 b061a65e51d79e985415b6c3c8e1fffa28159616
parent 430078 31078c9f49c180f1effb267087e79a6a7c98f9e8
child 430080 dc2bacb89a6bc38cf41831965f55f6838e12cb28
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflod
bugs1399082
milestone57.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 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
@@ -1423,23 +1423,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();
@@ -1885,21 +1886,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)