Bug 1412230 - Replace the word "Company" with "Organization". r=flod,lchang

MozReview-Commit-ID: 6e8dm5QMbxk

--HG--
extra : rebase_source : b5b6fff6f0b60147ba1c8426aa3bf30a4d8c39b5
This commit is contained in:
Scott Wu 2017-10-27 16:20:44 +08:00
parent b64b69ebdb
commit 38bfa383f7
5 changed files with 17 additions and 14 deletions

View File

@ -23,7 +23,7 @@ const AUTOFILL_CREDITCARDS_AVAILABLE_PREF = "extensions.formautofill.creditCards
const ENABLED_AUTOFILL_CREDITCARDS_PREF = "extensions.formautofill.creditCards.enabled";
const MANAGE_ADDRESSES_KEYWORDS = ["manageAddressesTitle", "addNewAddressTitle"];
const EDIT_ADDRESS_KEYWORDS = [
"givenName", "additionalName", "familyName", "organization", "streetAddress",
"givenName", "additionalName", "familyName", "organization2", "streetAddress",
"state", "province", "city", "country", "zip", "postalCode", "email", "tel",
];
const MANAGE_CREDITCARDS_KEYWORDS = ["manageCreditCardsTitle", "addNewCreditCardTitle", "showCreditCardsBtnLabel"];

View File

@ -26,7 +26,7 @@
<input id="family-name" type="text"/>
</label>
<label id="organization-container">
<span data-localization="organization"/>
<span data-localization="organization2"/>
<input id="organization" type="text"/>
</label>
<label id="street-address-container">

View File

@ -191,7 +191,6 @@
* @param {string[]} data.categories
* The categories of all the fields contained in the selected address.
*/
const namespace = "category.";
this._updateWarningNote = ({data} = {}) => {
let categories = (data && data.categories) ? data.categories : this._allFieldCategories;
// If the length of categories is 1, that means all the fillable fields are in the same
@ -199,14 +198,18 @@
// is true, we show "Also autofills ...", otherwise, show "Autofills ..." only.
let hasExtraCategories = categories.length > 1;
// Show the categories in certain order to conform with the spec.
let orderedCategoryList = ["address", "name", "organization", "tel", "email"];
let orderedCategoryList = [{id: "address", l10nId: "category.address"},
{id: "name", l10nId: "category.name"},
{id: "organization", l10nId: "category.organization2"},
{id: "tel", l10nId: "category.tel"},
{id: "email", l10nId: "category.email"}];
let showCategories = hasExtraCategories ?
orderedCategoryList.filter(category => categories.includes(category) && category != this._focusedCategory) :
[this._focusedCategory];
orderedCategoryList.filter(category => categories.includes(category.id) && category.id != this._focusedCategory) :
[orderedCategoryList.find(category => category.id == this._focusedCategory)];
let separator = this._stringBundle.GetStringFromName("fieldNameSeparator");
let warningTextTmplKey = hasExtraCategories ? "phishingWarningMessage" : "phishingWarningMessage2";
let categoriesText = showCategories.map(category => this._stringBundle.GetStringFromName(namespace + category)).join(separator);
let categoriesText = showCategories.map(category => this._stringBundle.GetStringFromName(category.l10nId)).join(separator);
this._warningTextBox.textContent = this._stringBundle.formatStringFromName(warningTextTmplKey,
[categoriesText], 1);

View File

@ -47,11 +47,11 @@ autocompleteFooterOptionOSX = Form Autofill Preferences
# instead of autocompleteFooterOption* when the menu width is below 185px.
autocompleteFooterOptionShort = More Options
autocompleteFooterOptionOSXShort = Preferences
# LOCALIZATION NOTE (category.address, category.name, category.organization, category.tel, category.email):
# LOCALIZATION NOTE (category.address, category.name, category.organization2, 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.organization2 = organization
category.tel = phone
category.email = email
# LOCALIZATION NOTE (fieldNameSeparator): This is used as a separator between categories.
@ -59,7 +59,7 @@ 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 autofills company, phone, email.
# The text would be e.g. Also autofills organization, phone, email.
phishingWarningMessage = Also autofills %S
phishingWarningMessage2 = Autofills %S
# LOCALIZATION NOTE (insecureFieldWarningDescription): %S is brandShortName. This string is used in drop down
@ -100,7 +100,7 @@ editAddressTitle = Edit Address
givenName = First Name
additionalName = Middle Name
familyName = Last Name
organization = Company
organization2 = Organization
streetAddress = Street Address
city = City
province = Province

View File

@ -73,14 +73,14 @@ add_task(async function test_phishing_warning_complex_categories() {
await BrowserTestUtils.withNewTab({gBrowser, url: URL}, async function(browser) {
await openPopupOn(browser, "#street-address");
await expectWarningText(browser, "Also autofills company, email");
await expectWarningText(browser, "Also autofills organization, email");
await BrowserTestUtils.synthesizeKey("VK_DOWN", {}, browser);
await expectWarningText(browser, "Autofills address");
await BrowserTestUtils.synthesizeKey("VK_DOWN", {}, browser);
await BrowserTestUtils.synthesizeKey("VK_DOWN", {}, browser);
await expectWarningText(browser, "Also autofills company, email");
await expectWarningText(browser, "Also autofills organization, email");
await BrowserTestUtils.synthesizeKey("VK_DOWN", {}, browser);
await expectWarningText(browser, "Also autofills company, email");
await expectWarningText(browser, "Also autofills organization, email");
await closePopup(browser);
});