bug 1399082 - about:telemetry l10n fixes r=flod
authorChris H-C <chutten@mozilla.com>
Tue, 12 Sep 2017 14:12:55 -0400
changeset 430115 6c8fd74d8dcf326d0f2c96d45847312ad2725ce6
parent 430114 db9ef4f3705b3a4541fef5093398ba43c110fc15
child 430116 34b7638b00c8f465b368b53901b1a4597becd653
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)