Bug 1315458 - Container management: Make "Preferences" and "Remove" buttons localizable. r?jkt draft
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 28 Dec 2016 15:42:43 +0100
changeset 454199 8e440c88026a0ea7d1447c0f4e70cda7c7f77b7c
parent 454198 6588fd305dd2c8b7a5ea187c6769dcf85b8af72f
child 540646 b2cb6fa0d40c329adb9c75410df31ee3058f72a6
push id39863
push userarchaeopteryx@coole-files.de
push dateWed, 28 Dec 2016 14:44:26 +0000
reviewersjkt
bugs1315458
milestone53.0a1
Bug 1315458 - Container management: Make "Preferences" and "Remove" buttons localizable. r?jkt MozReview-Commit-ID: 893cnROEPWf
browser/components/preferences/handlers.xml
browser/components/preferences/in-content/containers.js
browser/locales/en-US/chrome/browser/preferences/containers.dtd
browser/locales/en-US/chrome/browser/preferences/containers.properties
--- a/browser/components/preferences/handlers.xml
+++ b/browser/components/preferences/handlers.xml
@@ -3,18 +3,20 @@
 <!-- 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/. -->
 <!-- import-globals-from in-content/applications.js -->
 
 <!DOCTYPE overlay [
   <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
   <!ENTITY % applicationsDTD SYSTEM "chrome://browser/locale/preferences/applications.dtd">
+  <!ENTITY % containersDTD SYSTEM "chrome://browser/locale/preferences/containers.dtd">
   %brandDTD;
   %applicationsDTD;
+  %containersDTD;
 ]>
 
 <bindings id="handlerBindings"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
           xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="handler-base" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
@@ -73,24 +75,24 @@
     <content>
       <xul:hbox flex="1" equalsize="always">
         <xul:hbox flex="1" align="center">
           <xul:hbox xbl:inherits="data-identity-icon=containerIcon,data-identity-color=containerColor" height="24" width="24" class="userContext-icon"/>
           <xul:label flex="1" crop="end" xbl:inherits="value=containerName"/>
         </xul:hbox>
         <xul:hbox flex="1" align="right">
           <xul:button anonid="preferencesButton"
+                      label="&preferencesButton.label;"
                       xbl:inherits="value=userContextId"
-                      onclick="gContainersPane.onPeferenceClick(event.originalTarget)">
-            Preferences
+                      onclick="gContainersPane.onPreferenceClick(event.originalTarget)">
           </xul:button>
           <xul:button anonid="removeButton"
+                      label="&removeButton.label;"
                       xbl:inherits="value=userContextId"
                       onclick="gContainersPane.onRemoveClick(event.originalTarget)">
-            Remove
           </xul:button>
         </xul:hbox>
       </xul:hbox>
     </content>
   </binding>
 
   <binding id="offlineapp"
 	   extends="chrome://global/content/bindings/listbox.xml#listitem">
--- a/browser/components/preferences/in-content/containers.js
+++ b/browser/components/preferences/in-content/containers.js
@@ -62,17 +62,17 @@ let gContainersPane = {
 
       ContextualIdentityService.closeContainerTabs(userContextId);
     }
 
     ContextualIdentityService.remove(userContextId);
     this._rebuildView();
   },
 
-  onPeferenceClick(button) {
+  onPreferenceClick(button) {
     this.openPreferenceDialog(button.getAttribute("value"));
   },
 
   onAddButtonClick(button) {
     this.openPreferenceDialog(null);
   },
 
   openPreferenceDialog(userContextId) {
--- a/browser/locales/en-US/chrome/browser/preferences/containers.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/containers.dtd
@@ -1,15 +1,17 @@
 <!-- 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/. -->
 
 <!ENTITY label.label          "Name">
 <!ENTITY addButton.label      "Add New Container">
 <!ENTITY addButton.accesskey  "A">
+<!ENTITY preferencesButton.label "Preferences">
+<!ENTITY removeButton.label   "Remove">
 <!-- &#171; is &laquo; however it's not defined in XML -->
 <!ENTITY backLink.label       "&#171; Go Back to Privacy">
 
 <!ENTITY window.title         "Add New Container">
 <!ENTITY window.width         "45em">
 
 <!ENTITY name.label           "Name:">
 <!ENTITY name.accesskey       "N">
--- a/browser/locales/en-US/chrome/browser/preferences/containers.properties
+++ b/browser/locales/en-US/chrome/browser/preferences/containers.properties
@@ -1,14 +1,12 @@
 # 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/.
 
-containers.removeButton = Remove
-containers.preferencesButton = Preferences
 containers.colorHeading = Color:
 containers.labelMinWidth = 4rem
 containers.nameLabel = Name:
 containers.namePlaceholder = Enter a container name
 containers.submitButton = Done
 containers.iconHeading = Icon:
 containers.updateContainerTitle = %S Container Preferences