Bug 1399511 - Update message displayed when a section has no data in about:telemetry r?chutten
MozReview-Commit-ID: 2Hb4oKKlhG7
--- 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