Bug 1308503 - Migrate localization strings away from certManager.dtd; r=honza draft
authorFred Lin <gasolin@mozilla.com>
Thu, 13 Oct 2016 11:35:24 +0800
changeset 425027 9dd0fe3a143c40335ee947c8487833b4ee5574d3
parent 425021 7e0d01e910bf64c4872d93ff62cde6e6f003a7f6
child 533825 163b8ecf17819f538db183edf1c6885366c2b90b
push id32320
push userbmo:gasolin@mozilla.com
push dateFri, 14 Oct 2016 02:52:56 +0000
reviewershonza
bugs1308503
milestone52.0a1
Bug 1308503 - Migrate localization strings away from certManager.dtd; r=honza MozReview-Commit-ID: 2CKI1Ze9mqD
devtools/client/locales/en-US/netmonitor.properties
devtools/client/netmonitor/netmonitor.xul
devtools/client/netmonitor/panel.js
--- a/devtools/client/locales/en-US/netmonitor.properties
+++ b/devtools/client/locales/en-US/netmonitor.properties
@@ -300,8 +300,56 @@ netRequest.cookies=Cookies
 # LOCALIZATION NOTE (netRequest.params): A label used for URL parameters tab
 # This tab displays data parsed from URL query string.
 netRequest.params=Params
 
 # LOCALIZATION NOTE (netRequest.callstack): A label used for request stacktrace tab
 # This tab displays the request's JavaScript stack trace. Should be identical to
 # debuggerUI.tabs.callstack
 netRequest.callstack=Call Stack
+
+# LOCALIZATION NOTE (certmgr.subjectinfo.label):
+# A label used for a certificate section in security tab.
+# This section displays Name and organization who has been assigned the fingerprints
+certmgr.subjectinfo.label=Issued To
+
+# LOCALIZATION NOTE (certmgr.certdetail.cn):
+# A label used for Issued To and Issued By sub-section in security tab
+certmgr.certdetail.cn=Common Name (CN):
+
+# LOCALIZATION NOTE (certmgr.certdetail.o):
+# A label used for Issued To and Issued By sub-section in security tab
+certmgr.certdetail.o=Organization (O):
+
+# LOCALIZATION NOTE (certmgr.certdetail.ou):
+# A label used for Issued To and Issued By sub-section in security tab
+certmgr.certdetail.ou=Organizational Unit (OU):
+
+# LOCALIZATION NOTE (certmgr.issuerinfo.label):
+# A label used for a certificate section in security tab
+# This section displays Name and organization who issued the fingerprints
+certmgr.issuerinfo.label=Issued By
+
+# LOCALIZATION NOTE (certmgr.periodofvalidity.label):
+# A label used for a certificate section in security tab
+# This section displays the valide period of this fingerprints
+certmgr.periodofvalidity.label=Period of Validity
+
+# LOCALIZATION NOTE (certmgr.certdetail.cn):
+# A label used for Period of Validity sub-section in security tab
+certmgr.begins=Begins On:
+
+# LOCALIZATION NOTE (certmgr.certdetail.cn):
+# A label used for Period of Validity sub-section in security tab
+certmgr.expires=Expires On:
+
+# LOCALIZATION NOTE (certmgr.fingerprints.label):
+# A label used for a certificate section in security tab
+# This section displays the valide period of this fingerprints
+certmgr.fingerprints.label=Fingerprints
+
+# LOCALIZATION NOTE (certmgr.certdetail.sha256fingerprint):
+# A label used for Fingerprints sub-section in security tab
+certmgr.certdetail.sha256fingerprint=SHA-256 Fingerprint:
+
+# LOCALIZATION NOTE (certmgr.certdetail.sha1fingerprint):
+# A label used for Fingerprints sub-section in security tab
+certmgr.certdetail.sha1fingerprint=SHA1 Fingerprint:
--- a/devtools/client/netmonitor/netmonitor.xul
+++ b/devtools/client/netmonitor/netmonitor.xul
@@ -4,18 +4,16 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://devtools/content/shared/widgets/widgets.css" type="text/css"?>
 <?xml-stylesheet href="chrome://devtools/skin/widgets.css" type="text/css"?>
 <?xml-stylesheet href="chrome://devtools/skin/netmonitor.css" type="text/css"?>
 <!DOCTYPE window [
   <!ENTITY % netmonitorDTD SYSTEM "chrome://devtools/locale/netmonitor.dtd">
   %netmonitorDTD;
-  <!ENTITY % certManagerDTD SYSTEM "chrome://pippki/locale/certManager.dtd">
-  %certManagerDTD;
 ]>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml">
 
   <script type="application/javascript;version=1.8"
           src="chrome://devtools/content/shared/theme-switching.js"/>
   <script type="text/javascript" src="netmonitor-controller.js"/>
@@ -83,17 +81,20 @@
 
   <keyset>
     <key id="freeTextFilterKey"
          key="&netmonitorUI.footer.filterFreetext.key;"
          modifiers="accel"
          command="freeTextFilterCommand"/>
   </keyset>
 
-  <deck id="body" class="theme-sidebar" flex="1">
+  <deck id="body"
+        class="theme-sidebar"
+        data-localization-bundle="devtools/locale/netmonitor.properties"
+        flex="1">
 
     <vbox id="network-inspector-view" flex="1">
       <hbox id="netmonitor-toolbar" class="devtools-toolbar">
         <toolbarbutton id="requests-menu-clear-button"
                        class="devtools-toolbarbutton devtools-clear-icon"
                        tooltiptext="&netmonitorUI.footer.clear;"/>
         <hbox id="requests-menu-filter-buttons">
           <button id="requests-menu-filter-all-button"
@@ -715,122 +716,125 @@
                     </vbox>
                     <vbox id="security-info-certificate"
                           class="tabpanel-summary-container">
                         <label class="plain tabpanel-summary-label"
                                value="&netmonitorUI.security.certificate;"/>
                       <vbox class="security-info-section">
                         <vbox class="tabpanel-summary-container">
                           <label class="plain tabpanel-summary-label"
-                                 value="&certmgr.subjectinfo.label;" flex="1"/>
+                                 data-localization="content=certmgr.subjectinfo.label" flex="1"/>
                         </vbox>
                         <vbox class="security-info-section">
                           <hbox class="tabpanel-summary-container"
                                 align="baseline">
                             <label class="plain tabpanel-summary-label"
-                                   value="&certmgr.certdetail.cn;:"/>
+                                   data-localization="content=certmgr.certdetail.cn"/>
                             <textbox id="security-cert-subject-cn"
                                      class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
                                      flex="1"
                                      readonly="true"/>
                           </hbox>
                           <hbox class="tabpanel-summary-container"
                                 align="baseline">
                             <label class="plain tabpanel-summary-label"
-                                   value="&certmgr.certdetail.o;:"/>
+                                   data-localization="content=certmgr.certdetail.o"/>
                             <textbox id="security-cert-subject-o"
                                      class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
                                      flex="1"
                                      readonly="true"/>
                           </hbox>
                           <hbox class="tabpanel-summary-container"
                                 align="baseline">
                             <label class="plain tabpanel-summary-label"
-                                   value="&certmgr.certdetail.ou;:"/>
+                                   data-localization="content=certmgr.certdetail.ou"/>
                             <textbox id="security-cert-subject-ou"
                                      class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
                                      flex="1"
                                      readonly="true"/>
                           </hbox>
                         </vbox>
                         <vbox class="tabpanel-summary-container">
                           <label class="plain tabpanel-summary-label"
-                                 value="&certmgr.issuerinfo.label;" flex="1"/>
+                                 data-localization="content=certmgr.issuerinfo.label"
+                                 flex="1"/>
                         </vbox>
                         <vbox class="security-info-section">
                           <hbox class="tabpanel-summary-container"
                                 align="baseline">
                             <label class="plain tabpanel-summary-label"
-                                   value="&certmgr.certdetail.cn;:"/>
+                                   data-localization="content=certmgr.certdetail.cn"/>
                             <textbox id="security-cert-issuer-cn"
                                      class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
                                      flex="1"
                                      readonly="true"/>
                           </hbox>
                           <hbox class="tabpanel-summary-container"
                                 align="baseline">
                             <label class="plain tabpanel-summary-label"
-                                   value="&certmgr.certdetail.o;:"/>
+                                   data-localization="content=certmgr.certdetail.o"/>
                             <textbox id="security-cert-issuer-o"
                                      class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
                                      flex="1"
                                      readonly="true"/>
                           </hbox>
                           <hbox class="tabpanel-summary-container"
                                 align="baseline">
                             <label class="plain tabpanel-summary-label"
-                                   value="&certmgr.certdetail.ou;:"/>
+                                   data-localization="content=certmgr.certdetail.ou"/>
                             <textbox id="security-cert-issuer-ou"
                                      class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
                                      flex="1"
                                      readonly="true"/>
                           </hbox>
                         </vbox>
                         <vbox class="tabpanel-summary-container">
                           <label class="plain tabpanel-summary-label"
-                                 value="&certmgr.periodofvalidity.label;" flex="1"/>
+                                 data-localization="content=certmgr.periodofvalidity.label"
+                                 flex="1"/>
                         </vbox>
                         <vbox class="security-info-section">
                           <hbox class="tabpanel-summary-container"
                                 align="baseline">
                             <label class="plain tabpanel-summary-label"
-                                   value="&certmgr.begins;:"/>
+                                   data-localization="content=certmgr.begins"/>
                             <textbox id="security-cert-validity-begins"
                                      class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
                                      flex="1"
                                      readonly="true"/>
                           </hbox>
                           <hbox class="tabpanel-summary-container"
                                 align="baseline">
                             <label class="plain tabpanel-summary-label"
-                                   value="&certmgr.expires;:"/>
+                                   data-localization="content=certmgr.expires"/>
                             <textbox id="security-cert-validity-expires"
                                      class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
                                      flex="1"
                                      readonly="true"/>
                           </hbox>
                         </vbox>
                         <vbox class="tabpanel-summary-container">
                           <label class="plain tabpanel-summary-label"
-                                 value="&certmgr.fingerprints.label;" flex="1"/>
+                                 data-localization="content=certmgr.fingerprints.label"
+                                 flex="1"/>
                         </vbox>
                         <vbox class="security-info-section">
                           <hbox class="tabpanel-summary-container"
                                 align="baseline">
                             <label class="plain tabpanel-summary-label"
-                                   value="&certmgr.certdetail.sha256fingerprint;:"/>
+                                   data-localization="content=certmgr.certdetail.sha256fingerprint"/>
                             <textbox id="security-cert-sha256-fingerprint"
                                      class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
                                      flex="1"
                                      readonly="true"/>
                           </hbox>
                           <hbox class="tabpanel-summary-container"
                                 align="baseline">
                             <label class="plain tabpanel-summary-label"
-                                   value="&certmgr.certdetail.sha1fingerprint;:"/>
+                                   data-localization="content=certmgr.certdetail.sha1fingerprint"/>
                             <textbox id="security-cert-sha1-fingerprint"
                                      class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
                                      flex="1"
                                      readonly="true"/>
                           </hbox>
                         </vbox>
                       </vbox>
                     </vbox>
--- a/devtools/client/netmonitor/panel.js
+++ b/devtools/client/netmonitor/panel.js
@@ -3,19 +3,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const promise = require("promise");
 const EventEmitter = require("devtools/shared/event-emitter");
 const { Task } = require("devtools/shared/task");
+const { localizeMarkup } = require("devtools/shared/l10n");
 
 function NetMonitorPanel(iframeWindow, toolbox) {
   this.panelWin = iframeWindow;
+  this.panelDoc = iframeWindow.document;
   this._toolbox = toolbox;
 
   this._view = this.panelWin.NetMonitorView;
   this._controller = this.panelWin.NetMonitorController;
   this._controller._target = this.target;
   this._controller._toolbox = this._toolbox;
 
   EventEmitter.decorate(this);
@@ -29,16 +31,19 @@ NetMonitorPanel.prototype = {
    *
    * @return object
    *         A promise that is resolved when the NetMonitor completes opening.
    */
   open: Task.async(function* () {
     if (this._opening) {
       return this._opening;
     }
+    // Localize all the nodes containing a data-localization attribute.
+    localizeMarkup(this.panelDoc);
+
     let deferred = promise.defer();
     this._opening = deferred.promise;
 
     // Local monitoring needs to make the target remote.
     if (!this.target.isRemote) {
       yield this.target.makeRemote();
     }