Bug 1382193 - Avoid l10n issue in about:telemetry r=chutten,flod
authorflyingrub <flyinggrub@gmail.com>
Thu, 20 Jul 2017 12:35:57 +0200
changeset 419797 8b274bfe790511b3517f9dc98f54f56efc8dee7c
parent 419796 753f56ca9c9f234cc58ad1dd096e8ee4b8b95894
child 419798 76ec2bd0f25126da421ce9c9150a6a92450f5ce1
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten, flod
bugs1382193
milestone56.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 1382193 - Avoid l10n issue in about:telemetry r=chutten,flod Provide a translation of "current". Prevent issue with the order of the word by adding another string when we display the current ping. MozReview-Commit-ID: AOHXGrlm2Dt
toolkit/content/aboutTelemetry.js
toolkit/locales/en-US/chrome/global/aboutTelemetry.properties
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -352,33 +352,36 @@ var PingPicker = {
     let pingDate = document.getElementById("ping-date");
     pingDate.textContent = pingName;
     pingDate.setAttribute("title", pingName);
 
     // Display the type and controls if the ping is not current
     let pingType = document.getElementById("ping-type");
     let older = document.getElementById("older-ping");
     let newer = document.getElementById("newer-ping");
-    if (pingName !== "current") {
+    let explanation;
+    if (!this.viewCurrentPingData) {
+      let pingTypeText = this._getSelectedPingType();
       pingType.hidden = false;
       older.hidden = false;
       newer.hidden = false;
-      pingType.textContent = this._getSelectedPingType();
+      pingType.textContent = pingTypeText;
+      pingName = bundle.formatStringFromName("namedPing", [pingName, pingTypeText], 2);
+      let pingNameHtml = "<span class=\"change-ping\">" + pingName + "</span>";
+      let parameters = [pingLink, pingNameHtml, pingTypeText];
+      explanation = bundle.formatStringFromName("pingDetails", parameters, 3);
     } else {
       pingType.hidden = true;
       older.hidden = true;
       newer.hidden = true;
+      pingDate.textContent = bundle.GetStringFromName("currentPingSidebar");
+      let pingNameHtml = "<span class=\"change-ping\">" + pingName + "</span>";
+      explanation = bundle.formatStringFromName("pingDetailsCurrent", [pingLink, pingNameHtml], 2);
     }
 
-    if (pingName !== "current") {
-      pingName += ", " + this._getSelectedPingType();
-    }
-    let pingNameHtml = "<span class=\"change-ping\">" + pingName + "</span>";
-
-    let explanation = bundle.formatStringFromName("pingDetails", [pingLink, pingNameHtml], 2);
     let pingExplanation = document.getElementById("ping-explanation");
 
     // eslint-disable-next-line no-unsanitized/property
     pingExplanation.innerHTML = explanation;
     pingExplanation.querySelector(".change-ping").addEventListener("click", () =>
       document.getElementById("ping-picker").classList.remove("hidden")
     );
 
@@ -538,17 +541,17 @@ var PingPicker = {
         }
         option.hidden = (type != this.TYPE_ALL) && (option.dataset.type != type);
       });
     });
     this._updateArchivedPingData();
   },
 
   _getSelectedPingName() {
-    if (this.viewCurrentPingData) return "current";
+    if (this.viewCurrentPingData) return bundle.GetStringFromName("currentPing");
 
     let pingSelector = document.getElementById("choose-ping-id");
     let selected = pingSelector.selectedOptions.item(0);
     return selected.dataset.date;
   },
 
   _getSelectedPingType() {
     let pingSelector = document.getElementById("choose-ping-id");
--- a/toolkit/locales/en-US/chrome/global/aboutTelemetry.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutTelemetry.properties
@@ -9,29 +9,44 @@ pageSubtitle = This page shows the infor
 
 # Note to translators:
 # - %1$S will be replaced by either telemetryEnabled or telemetryDisabled
 # - %2$S will be replaced by either extendedTelemetryEnabled or extendedTelemetryDisabled
 homeExplanation = Telemetry is %1$S and extended telemetry is %2$S.
 
 # Note to translators:
 # - %1$S will be replaced by a link with pingExplanationLink
-# - %2$S will be replaced by the ping name
-pingDetails = Each piece of information is sent bundled into “%1$S“. You are looking at the %2$S ping.
+# - %2$S will be replaced by the namedPing
+pingDetails = Each piece of information is sent bundled into “%1$S”. You are looking at the %2$S ping.
+
+# Note to translators:
+# - %1$S will be replaced by the ping timestamp, e.g. "2017/07/08 10:40:46"
+# - %2$S will be replaced by the ping name, e.g. "saved-session"
+namedPing = %1$S, %2$S
+
+# Note to translators:
+# - %1$S will be replaced by a link with pingExplanationLink
+# - %2$S will be replaced by currentPing
+pingDetailsCurrent = Each piece of information is sent bundled into “%1$S“. You are looking at the %2$S ping.
 
 pingExplanationLink = pings
 
 telemetryEnabled = enabled
 
 telemetryDisabled = disabled
 
 extendedTelemetryEnabled = enabled
 
 extendedTelemetryDisabled = disabled
 
+currentPing = current
+
+# Used as a tooltip for the "current" ping title in the sidebar
+currentPingSidebar = current ping
+
 telemetryPingTypeAll = all
 
 telemetryLogTitle = Telemetry Log
 
 telemetryLogHeadingId = Id
 
 telemetryLogHeadingTimestamp = Timestamp