Bug 1407530 - Update formautofill.properties string IDs and localization notes. r=lchang,flod
MozReview-Commit-ID: uHWhQmrVgu
--- a/browser/extensions/formautofill/FormAutofillDoorhanger.jsm
+++ b/browser/extensions/formautofill/FormAutofillDoorhanger.jsm
@@ -18,31 +18,32 @@ const {classes: Cc, interfaces: Ci, util
Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://formautofill/FormAutofillUtils.jsm");
this.log = null;
FormAutofillUtils.defineLazyLogGetter(this, this.EXPORTED_SYMBOLS[0]);
-const BUNDLE_URI = "chrome://formautofill/locale/formautofill.properties";
-const GetStringFromName = Services.strings.createBundle(BUNDLE_URI).GetStringFromName;
+const GetStringFromName = FormAutofillUtils.stringBundle.GetStringFromName;
+const formatStringFromName = FormAutofillUtils.stringBundle.formatStringFromName;
+const brandShortName = FormAutofillUtils.brandBundle.GetStringFromName("brandShortName");
let changeAutofillOptsKey = "changeAutofillOptions";
let autofillOptsKey = "autofillOptionsLink";
let autofillSecurityOptionsKey = "autofillSecurityOptionsLink";
if (AppConstants.platform == "macosx") {
changeAutofillOptsKey += "OSX";
autofillOptsKey += "OSX";
autofillSecurityOptionsKey += "OSX";
}
const CONTENT = {
firstTimeUse: {
notificationId: "autofill-address",
- message: GetStringFromName("saveAddressesMessage"),
+ message: formatStringFromName("saveAddressesMessage", [brandShortName], 1),
anchor: {
id: "autofill-address-notification-icon",
URL: "chrome://formautofill/content/formfill-anchor.svg",
tooltiptext: GetStringFromName("openAutofillMessagePanel"),
},
mainAction: {
label: GetStringFromName(changeAutofillOptsKey),
accessKey: "C",
@@ -92,17 +93,17 @@ const CONTENT = {
options: {
persistWhileVisible: true,
popupIconURL: "chrome://formautofill/content/icon-address-update.svg",
hideClose: true,
},
},
creditCard: {
notificationId: "autofill-credit-card",
- message: GetStringFromName("saveCreditCardMessage"),
+ message: formatStringFromName("saveCreditCardMessage", [brandShortName], 1),
linkMessage: GetStringFromName(autofillSecurityOptionsKey),
anchor: {
id: "autofill-credit-card-notification-icon",
URL: "chrome://formautofill/content/formfill-anchor.svg",
tooltiptext: GetStringFromName("openAutofillMessagePanel"),
},
mainAction: {
label: GetStringFromName("saveCreditCardLabel"),
--- a/browser/extensions/formautofill/FormAutofillPreferences.jsm
+++ b/browser/extensions/formautofill/FormAutofillPreferences.jsm
@@ -82,19 +82,19 @@ FormAutofillPreferences.prototype = {
savedAddressesBtn.className = "accessory-button";
addressAutofillCheckbox.className = "tail-with-learn-more";
addressAutofillLearnMore.className = "learnMore text-link";
formAutofillGroup.id = "formAutofillGroup";
addressAutofill.id = "addressAutofill";
addressAutofillLearnMore.id = "addressAutofillLearnMore";
- addressAutofillLearnMore.setAttribute("value", this.bundle.GetStringFromName("learnMore"));
- addressAutofillCheckbox.setAttribute("label", this.bundle.GetStringFromName("enableAddressAutofill"));
- savedAddressesBtn.setAttribute("label", this.bundle.GetStringFromName("savedAddresses"));
+ addressAutofillLearnMore.setAttribute("value", this.bundle.GetStringFromName("learnMoreLabel"));
+ addressAutofillCheckbox.setAttribute("label", this.bundle.GetStringFromName("autofillAddressesCheckbox"));
+ savedAddressesBtn.setAttribute("label", this.bundle.GetStringFromName("savedAddressesBtnLabel"));
addressAutofillLearnMore.setAttribute("href", learnMoreURL);
// Add preferences search support
savedAddressesBtn.setAttribute("searchkeywords", MANAGE_ADDRESSES_KEYWORDS.concat(EDIT_ADDRESS_KEYWORDS)
.map(key => this.bundle.GetStringFromName(key)).join("\n"));
// Manually set the checked state
@@ -125,19 +125,19 @@ FormAutofillPreferences.prototype = {
let savedCreditCardsBtn = document.createElementNS(XUL_NS, "button");
savedCreditCardsBtn.className = "accessory-button";
creditCardAutofillCheckbox.className = "tail-with-learn-more";
creditCardAutofillLearnMore.className = "learnMore text-link";
creditCardAutofill.id = "creditCardAutofill";
creditCardAutofillLearnMore.id = "creditCardAutofillLearnMore";
- creditCardAutofillLearnMore.setAttribute("value", this.bundle.GetStringFromName("learnMore"));
- creditCardAutofillCheckbox.setAttribute("label", this.bundle.GetStringFromName("enableCreditCardAutofill"));
- savedCreditCardsBtn.setAttribute("label", this.bundle.GetStringFromName("savedCreditCards"));
+ creditCardAutofillLearnMore.setAttribute("value", this.bundle.GetStringFromName("learnMoreLabel"));
+ creditCardAutofillCheckbox.setAttribute("label", this.bundle.GetStringFromName("autofillCreditCardsCheckbox"));
+ savedCreditCardsBtn.setAttribute("label", this.bundle.GetStringFromName("savedCreditCardsBtnLabel"));
creditCardAutofillLearnMore.setAttribute("href", learnMoreURL);
// Add preferences search support
savedCreditCardsBtn.setAttribute("searchkeywords", MANAGE_CREDITCARDS_KEYWORDS.concat(EDIT_CREDITCARD_KEYWORDS)
.map(key => this.bundle.GetStringFromName(key)).join("\n"));
// Manually set the checked state
--- a/browser/extensions/formautofill/FormAutofillUtils.jsm
+++ b/browser/extensions/formautofill/FormAutofillUtils.jsm
@@ -21,17 +21,17 @@ const CREDITCARDS_COLLECTION_NAME = "cre
const ENABLED_AUTOFILL_ADDRESSES_PREF = "extensions.formautofill.addresses.enabled";
const AUTOFILL_CREDITCARDS_AVAILABLE_PREF = "extensions.formautofill.creditCards.available";
const ENABLED_AUTOFILL_CREDITCARDS_PREF = "extensions.formautofill.creditCards.enabled";
const MANAGE_ADDRESSES_KEYWORDS = ["manageAddressesTitle", "addNewAddressTitle"];
const EDIT_ADDRESS_KEYWORDS = [
"givenName", "additionalName", "familyName", "organization", "streetAddress",
"state", "province", "city", "country", "zip", "postalCode", "email", "tel",
];
-const MANAGE_CREDITCARDS_KEYWORDS = ["manageCreditCardsTitle", "addNewCreditCardTitle", "showCreditCards"];
+const MANAGE_CREDITCARDS_KEYWORDS = ["manageCreditCardsTitle", "addNewCreditCardTitle", "showCreditCardsBtnLabel"];
const EDIT_CREDITCARD_KEYWORDS = ["cardNumber", "nameOnCard", "cardExpires"];
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
this.FormAutofillUtils = {
get AUTOFILL_FIELDS_THRESHOLD() { return 3; },
get isAutofillEnabled() { return this.isAutofillAddressesEnabled || this.isAutofillCreditCardsEnabled; },
@@ -531,14 +531,18 @@ XPCOMUtils.defineLazyGetter(this.FormAut
this.log = null;
this.FormAutofillUtils.defineLazyLogGetter(this, this.EXPORTED_SYMBOLS[0]);
XPCOMUtils.defineLazyGetter(FormAutofillUtils, "stringBundle", function() {
return Services.strings.createBundle("chrome://formautofill/locale/formautofill.properties");
});
+XPCOMUtils.defineLazyGetter(FormAutofillUtils, "brandBundle", function() {
+ return Services.strings.createBundle("chrome://branding/locale/brand.properties");
+});
+
XPCOMUtils.defineLazyPreferenceGetter(this.FormAutofillUtils,
"isAutofillAddressesEnabled", ENABLED_AUTOFILL_ADDRESSES_PREF);
XPCOMUtils.defineLazyPreferenceGetter(this.FormAutofillUtils,
"isAutofillCreditCardsAvailable", AUTOFILL_CREDITCARDS_AVAILABLE_PREF);
XPCOMUtils.defineLazyPreferenceGetter(this.FormAutofillUtils,
"_isAutofillCreditCardsEnabled", ENABLED_AUTOFILL_CREDITCARDS_PREF);
--- a/browser/extensions/formautofill/ProfileAutoCompleteResult.jsm
+++ b/browser/extensions/formautofill/ProfileAutoCompleteResult.jsm
@@ -7,19 +7,16 @@
this.EXPORTED_SYMBOLS = ["AddressResult", "CreditCardResult"]; /* exported AddressResult, CreditCardResult */
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://formautofill/FormAutofillUtils.jsm");
-XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
- return Services.strings.createBundle("chrome://branding/locale/brand.properties");
-});
XPCOMUtils.defineLazyPreferenceGetter(this, "insecureWarningEnabled", "security.insecure_field_warning.contextual.enabled");
this.log = null;
FormAutofillUtils.defineLazyLogGetter(this, this.EXPORTED_SYMBOLS[0]);
class ProfileAutoCompleteResult {
constructor(searchString, focusedFieldName, allFieldNames, matchingProfiles, {
resultCode = null,
@@ -328,17 +325,17 @@ class CreditCardResult extends ProfileAu
return ""; // Nothing matched.
}
_generateLabels(focusedFieldName, allFieldNames, profiles) {
if (!this._isSecure) {
if (!insecureWarningEnabled) {
return [];
}
- let brandName = gBrandBundle.GetStringFromName("brandShortName");
+ let brandName = FormAutofillUtils.brandBundle.GetStringFromName("brandShortName");
return [FormAutofillUtils.stringBundle.formatStringFromName("insecureFieldWarningDescription", [brandName], 1)];
}
// Skip results without a primary label.
let labels = profiles.filter(profile => {
return !!profile[focusedFieldName];
}).map(profile => {
--- a/browser/extensions/formautofill/content/editAddress.xhtml
+++ b/browser/extensions/formautofill/content/editAddress.xhtml
@@ -58,18 +58,18 @@
<input id="email" type="email"/>
</label>
<label id="tel-container">
<span data-localization="tel"/>
<input id="tel" type="tel"/>
</label>
</form>
<div id="controls-container">
- <button id="cancel" data-localization="cancel"/>
- <button id="save" disabled="disabled" data-localization="save"/>
+ <button id="cancel" data-localization="cancelBtnLabel"/>
+ <button id="save" disabled="disabled" data-localization="saveBtnLabel"/>
</div>
<script type="application/javascript"><![CDATA[
"use strict";
/* global EditAddress */
new EditAddress({
title: document.querySelector("title"),
form: document.getElementById("form"),
addressLevel1Label: document.querySelector("#address-level1-container > span"),
--- a/browser/extensions/formautofill/content/editCreditCard.xhtml
+++ b/browser/extensions/formautofill/content/editCreditCard.xhtml
@@ -39,18 +39,18 @@
<option value="12">12</option>
</select>
<select id="cc-exp-year">
<option/>
</select>
</div>
</form>
<div id="controls-container">
- <button id="cancel" data-localization="cancel"/>
- <button id="save" disabled="disabled" data-localization="save"/>
+ <button id="cancel" data-localization="cancelBtnLabel"/>
+ <button id="save" disabled="disabled" data-localization="saveBtnLabel"/>
</div>
<script type="application/javascript"><![CDATA[
"use strict";
/* global EditCreditCard */
new EditCreditCard({
title: document.querySelector("title"),
form: document.getElementById("form"),
ccNumber: document.getElementById("cc-number"),
--- a/browser/extensions/formautofill/content/manageAddresses.xhtml
+++ b/browser/extensions/formautofill/content/manageAddresses.xhtml
@@ -11,22 +11,22 @@
<script src="chrome://formautofill/content/manageDialog.js"></script>
</head>
<body>
<fieldset>
<legend data-localization="addressesListHeader"/>
<select id="addresses" size="9" multiple="multiple"/>
</fieldset>
<div id="controls-container">
- <button id="remove" disabled="disabled" data-localization="remove"/>
+ <button id="remove" disabled="disabled" data-localization="removeBtnLabel"/>
<!-- Wrapper is used to properly compute the search tooltip position -->
<div>
- <button id="add" data-localization="add"/>
+ <button id="add" data-localization="addBtnLabel"/>
</div>
- <button id="edit" disabled="disabled" data-localization="edit"/>
+ <button id="edit" disabled="disabled" data-localization="editBtnLabel"/>
</div>
<script type="application/javascript">
"use strict";
/* global ManageAddresses */
new ManageAddresses({
records: document.getElementById("addresses"),
controlsContainer: document.getElementById("controls-container"),
remove: document.getElementById("remove"),
--- a/browser/extensions/formautofill/content/manageCreditCards.xhtml
+++ b/browser/extensions/formautofill/content/manageCreditCards.xhtml
@@ -11,23 +11,23 @@
<script src="chrome://formautofill/content/manageDialog.js"></script>
</head>
<body>
<fieldset>
<legend data-localization="creditCardsListHeader"/>
<select id="credit-cards" size="9" multiple="multiple"/>
</fieldset>
<div id="controls-container">
- <button id="remove" disabled="disabled" data-localization="remove"/>
- <button id="show-hide-credit-cards" data-localization="showCreditCards"/>
+ <button id="remove" disabled="disabled" data-localization="removeBtnLabel"/>
+ <button id="show-hide-credit-cards" data-localization="showCreditCardsBtnLabel"/>
<!-- Wrapper is used to properly compute the search tooltip position -->
<div>
- <button id="add" data-localization="add"/>
+ <button id="add" data-localization="addBtnLabel"/>
</div>
- <button id="edit" disabled="disabled" data-localization="edit"/>
+ <button id="edit" disabled="disabled" data-localization="editBtnLabel"/>
</div>
<script type="application/javascript">
"use strict";
/* global ManageCreditCards */
new ManageCreditCards({
records: document.getElementById("credit-cards"),
controlsContainer: document.getElementById("controls-container"),
remove: document.getElementById("remove"),
--- a/browser/extensions/formautofill/content/manageDialog.js
+++ b/browser/extensions/formautofill/content/manageDialog.js
@@ -407,18 +407,18 @@ class ManageCreditCards extends ManageRe
updateShowHideButtonState() {
if (this._elements.records.length) {
this._elements.showHideCreditCards.removeAttribute("disabled");
} else {
this._elements.showHideCreditCards.setAttribute("disabled", true);
}
this._elements.showHideCreditCards.textContent =
- this._isDecrypted ? FormAutofillUtils.stringBundle.GetStringFromName("hideCreditCards") :
- FormAutofillUtils.stringBundle.GetStringFromName("showCreditCards");
+ this._isDecrypted ? FormAutofillUtils.stringBundle.GetStringFromName("hideCreditCardsBtnLabel") :
+ FormAutofillUtils.stringBundle.GetStringFromName("showCreditCardsBtnLabel");
}
handleClick(event) {
if (event.target == this._elements.showHideCreditCards) {
this.toggleShowHideCards(this._elements.records.options);
}
super.handleClick(event);
}
--- a/browser/extensions/formautofill/locales/en-US/formautofill.properties
+++ b/browser/extensions/formautofill/locales/en-US/formautofill.properties
@@ -1,80 +1,120 @@
# 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/.
-preferenceGroupTitle = Form Autofill
-enableAddressAutofill = Autofill addresses
-learnMore = Learn more
-savedAddresses = Saved Addresses…
-enableCreditCardAutofill = Autofill credit cards
-savedCreditCards = Saved Credit Cards…
-saveAddressesMessage = Firefox now saves addresses so you can fill out forms faster.
+# LOCALIZATION NOTE (saveAddressesMessage): %S is brandShortName. This string is used on the doorhanger to
+# notify users that addresses are saved.
+saveAddressesMessage = %S now saves addresses so you can fill out forms faster.
+# LOCALIZATION NOTE (autofillOptionsLink, autofillOptionsLinkOSX): These strings are used in the doorhanger for
+# updating addresses. The link leads users to Form Autofill browser preferences.
autofillOptionsLink = Form Autofill Options
+autofillOptionsLinkOSX = Form Autofill Preferences
+# LOCALIZATION NOTE (autofillSecurityOptionsLink, autofillSecurityOptionsLinkOSX): These strings are used
+# in the doorhanger for saving credit card info. The link leads users to Form Autofill browser preferences.
autofillSecurityOptionsLink = Form Autofill & Security Options
+autofillSecurityOptionsLinkOSX = Form Autofill & Security Preferences
+# LOCALIZATION NOTE (changeAutofillOptions, changeAutofillOptionsOSX): These strings are used on the doorhanger
+# that notifies users that addresses are saved. The button leads users to Form Autofill browser preferences.
changeAutofillOptions = Change Form Autofill Options
-autofillOptionsLinkOSX = Form Autofill Preferences
-autofillSecurityOptionsLinkOSX = Form Autofill & Security Preferences
changeAutofillOptionsOSX = Change Form Autofill Preferences
+# LOCALIZATION NOTE (addressesSyncCheckbox): If Sync is enabled, this checkbox is displayed on the doorhanger
+# shown when saving addresses.
addressesSyncCheckbox = Share addresses with synced devices
+# LOCALIZATION NOTE (updateAddressMessage, createAddressLabel, updateAddressLabel): Used on the doorhanger
+# when an address change is detected.
updateAddressMessage = Would you like to update your address with this new information?
createAddressLabel = Create New Address
updateAddressLabel = Update Address
-saveCreditCardMessage = Would you like Firefox to save this credit card? (Security code will not be saved)
+# LOCALIZATION NOTE (saveCreditCardMessage, saveCreditCardLabel, cancelCreditCardLabel, neverSaveCreditCardLabel):
+# Used on the doorhanger when users submit payment with credit card.
+# LOCALIZATION NOTE (saveCreditCardMessage): %S is brandShortName.
+saveCreditCardMessage = Would you like %S to save this credit card? (Security code will not be saved)
saveCreditCardLabel = Save Credit Card
cancelCreditCardLabel = Don’t Save
neverSaveCreditCardLabel = Never Save Credit Cards
+# LOCALIZATION NOTE (openAutofillMessagePanel): Tooltip label for Form Autofill doorhanger icon on address bar.
openAutofillMessagePanel = Open Form Autofill message panel
+
+# LOCALIZATION NOTE (autocompleteFooterOption, autocompleteFooterOptionOSX): Used as a label for the button,
+# displayed at the bottom of the drop down suggestion, to open Form Autofill browser preferences.
autocompleteFooterOption = Form Autofill Options
+autocompleteFooterOptionOSX = Form Autofill Preferences
+# LOCALIZATION NOTE (autocompleteFooterOptionShort, autocompleteFooterOptionOSXShort): Used as a label for the button,
+# displayed at the bottom of the drop down suggestion, to open Form Autofill browser preferences. This version is used
+# instead of autocompleteFooterOption* when the menu width is below 185px.
autocompleteFooterOptionShort = More Options
-autocompleteFooterOptionOSX = Form Autofill Preferences
autocompleteFooterOptionOSXShort = Preferences
+# LOCALIZATION NOTE (category.address, category.name, category.organization, category.tel, category.email):
+# Used in autofill drop down suggestion to indicate what other categories Form Autofill will attempt to fill.
category.address = address
category.name = name
category.organization = company
category.tel = phone
category.email = email
# LOCALIZATION NOTE (fieldNameSeparator): This is used as a separator between categories.
fieldNameSeparator = ,\u0020
# LOCALIZATION NOTE (phishingWarningMessage, phishingWarningMessage2): The warning
# text that is displayed for informing users what categories are about to be filled.
# "%S" will be replaced with a list generated from the pre-defined categories.
-# The text would be e.g. Also fill company, phone, email
+# The text would be e.g. Also autofills company, phone, email.
phishingWarningMessage = Also autofills %S
phishingWarningMessage2 = Autofills %S
+# LOCALIZATION NOTE (insecureFieldWarningDescription): %S is brandShortName. This string is used in drop down
+# suggestion when users try to autofill credit card on an insecure website (without https).
+insecureFieldWarningDescription = %S has detected an insecure site. Form Autofill is temporarily disabled
+# LOCALIZATION NOTE (autofillAddressesCheckbox): Label for the checkbox that enables autofilling addresses.
+autofillAddressesCheckbox = Autofill addresses
+# LOCALIZATION NOTE (learnMoreLabel): Label for the link that leads users to the Form Autofill SUMO page.
+learnMoreLabel = Learn more
+# LOCALIZATION NOTE (savedAddressesBtnLabel): Label for the button that opens a dialog that shows the
+# list of saved addresses.
+savedAddressesBtnLabel = Saved Addresses…
+# LOCALIZATION NOTE (autofillCreditCardsCheckbox): Label for the checkbox that enables autofilling credit cards.
+autofillCreditCardsCheckbox = Autofill credit cards
+# LOCALIZATION NOTE (savedCreditCardsBtnLabel): Label for the button that opens a dialog that shows the list
+# of saved credit cards.
+savedCreditCardsBtnLabel = Saved Credit Cards…
+
+# LOCALIZATION NOTE (manageAddressesTitle, manageCreditCardsTitle): The dialog title for the list of addresses or
+# credit cards in browser preferences.
manageAddressesTitle = Saved Addresses
manageCreditCardsTitle = Saved Credit Cards
+# LOCALIZATION NOTE (addressesListHeader, creditCardsListHeader): The header for the list of addresses or credit cards
+# in browser preferences.
addressesListHeader = Addresses
creditCardsListHeader = Credit Cards
-showCreditCards = Show Credit Cards
-hideCreditCards = Hide Credit Cards
-remove = Remove
-add = Add…
-edit = Edit…
+showCreditCardsBtnLabel = Show Credit Cards
+hideCreditCardsBtnLabel = Hide Credit Cards
+removeBtnLabel = Remove
+addBtnLabel = Add…
+editBtnLabel = Edit…
+# LOCALIZATION NOTE (addNewAddressTitle, editAddressTitle): The dialog title for creating or editing addresses
+# in browser preferences.
addNewAddressTitle = Add New Address
editAddressTitle = Edit Address
givenName = First Name
additionalName = Middle Name
familyName = Last Name
organization = Company
streetAddress = Street Address
city = City
province = Province
state = State
postalCode = Postal Code
zip = Zip Code
country = Country or Region
tel = Phone
email = Email
-cancel = Cancel
-save = Save
-countryWarningMessage = Autofill is currently available only for US addresses
+cancelBtnLabel = Cancel
+saveBtnLabel = Save
+countryWarningMessage = Form Autofill is currently available only for US addresses
+# LOCALIZATION NOTE (addNewCreditCardTitle, editCreditCardTitle): The dialog title for creating or editing
+# credit cards in browser preferences.
addNewCreditCardTitle = Add New Credit Card
editCreditCardTitle = Edit Credit Card
cardNumber = Card Number
nameOnCard = Name on Card
cardExpires = Expires
-
-insecureFieldWarningDescription = %S has detected an insecure site. Credit card autofill is temporarily disabled