diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 8b52c63d05f6..f4de7287a69e 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -6402,9 +6402,9 @@ var PermissionsHelper = { "offline-app", "desktop-notification", "plugins", "native-intent"], _permissionStrings: { "password": { - label: "password.savePassword", - allowed: "password.save", - denied: "password.dontSave" + label: "password.rememberPassword", + allowed: "password.remember", + denied: "password.never" }, "geolocation": { label: "geolocation.shareLocation", diff --git a/mobile/android/components/LoginManagerPrompter.js b/mobile/android/components/LoginManagerPrompter.js index 26623493ad15..c16440a1b0ca 100644 --- a/mobile/android/components/LoginManagerPrompter.js +++ b/mobile/android/components/LoginManagerPrompter.js @@ -62,6 +62,20 @@ LoginManagerPrompter.prototype = { return this.__strBundle; }, + __brandBundle : null, // String bundle for L10N + get _brandBundle() { + if (!this.__brandBundle) { + var bunService = Cc["@mozilla.org/intl/stringbundle;1"]. + getService(Ci.nsIStringBundleService); + this.__brandBundle = bunService.createBundle( + "chrome://branding/locale/brand.properties"); + if (!this.__brandBundle) + throw "Branding string bundle not present!"; + } + + return this.__brandBundle; + }, + __ellipsis : null, get _ellipsis() { @@ -159,13 +173,37 @@ LoginManagerPrompter.prototype = { * */ _showSaveLoginNotification : function (aLogin) { + + // Ugh. We can't use the strings from the popup window, because they + // have the access key marked in the string (eg "Mo&zilla"), along + // with some weird rules for handling access keys that do not occur + // in the string, for L10N. See commonDialog.js's setLabelForNode(). + var neverButtonText = + this._getLocalizedString("notifyBarNeverForSiteButtonText"); + var neverButtonAccessKey = + this._getLocalizedString("notifyBarNeverForSiteButtonAccessKey"); + var rememberButtonText = + this._getLocalizedString("notifyBarRememberButtonText"); + var rememberButtonAccessKey = + this._getLocalizedString("notifyBarRememberButtonAccessKey"); + var notNowButtonText = + this._getLocalizedString("notifyBarNotNowButtonText"); + var notNowButtonAccessKey = + this._getLocalizedString("notifyBarNotNowButtonAccessKey"); + + var brandShortName = + this._brandBundle.GetStringFromName("brandShortName"); var displayHost = this._getShortDisplayHost(aLogin.hostname); var notificationText; if (aLogin.username) { var displayUser = this._sanitizeUsername(aLogin.username); - notificationText = this._getLocalizedString("savePassword", [displayUser, displayHost]); + notificationText = this._getLocalizedString( + "saveLoginText", + [brandShortName, displayUser, displayHost]); } else { - notificationText = this._getLocalizedString("savePasswordNoUser", [displayHost]); + notificationText = this._getLocalizedString( + "saveLoginTextNoUsername", + [brandShortName, displayHost]); } // The callbacks in |buttons| have a closure to access the variables @@ -173,18 +211,34 @@ LoginManagerPrompter.prototype = { // without a getService() call. var pwmgr = this._pwmgr; + var buttons = [ + // "Remember" button { - label: this._getLocalizedString("saveButton"), + label: rememberButtonText, + accessKey: rememberButtonAccessKey, + popup: null, callback: function() { pwmgr.addLogin(aLogin); } }, + + // "Never for this site" button { - label: this._getLocalizedString("dontSaveButton"), + label: neverButtonText, + accessKey: neverButtonAccessKey, + popup: null, callback: function() { - // Don't set a permanent exception + pwmgr.setLoginSavingEnabled(aLogin.hostname, false); } + }, + + // "Not now" button + { + label: notNowButtonText, + accessKey: notNowButtonAccessKey, + popup: null, + callback: function() { /* NOP */ } } ]; @@ -213,25 +267,44 @@ LoginManagerPrompter.prototype = { var notificationText; if (aOldLogin.username) { let displayUser = this._sanitizeUsername(aOldLogin.username); - notificationText = this._getLocalizedString("updatePassword", [displayUser]); + notificationText = this._getLocalizedString( + "passwordChangeText", + [displayUser]); } else { - notificationText = this._getLocalizedString("updatePasswordNoUser"); + notificationText = this._getLocalizedString( + "passwordChangeTextNoUser"); } + var changeButtonText = + this._getLocalizedString("notifyBarChangeButtonText"); + var changeButtonAccessKey = + this._getLocalizedString("notifyBarChangeButtonAccessKey"); + var dontChangeButtonText = + this._getLocalizedString("notifyBarDontChangeButtonText"); + var dontChangeButtonAccessKey = + this._getLocalizedString("notifyBarDontChangeButtonAccessKey"); + // The callbacks in |buttons| have a closure to access the variables // in scope here; set one to |this._pwmgr| so we can get back to pwmgr // without a getService() call. var self = this; var buttons = [ + // "Yes" button { - label: this._getLocalizedString("updateButton"), + label: changeButtonText, + accessKey: changeButtonAccessKey, + popup: null, callback: function() { self._updateLogin(aOldLogin, aNewPassword); } }, + + // "No" button { - label: this._getLocalizedString("dontUpdateButton"), + label: dontChangeButtonText, + accessKey: dontChangeButtonAccessKey, + popup: null, callback: function() { // do nothing } diff --git a/mobile/android/components/PromptService.js b/mobile/android/components/PromptService.js index 727804a0fc55..6a95ae55d906 100644 --- a/mobile/android/components/PromptService.js +++ b/mobile/android/components/PromptService.js @@ -552,7 +552,7 @@ let PromptUtils = { let check = { value: false }; let selectedLogin; - checkLabel = this.getLocaleString("saveButton", "passwdmgr"); + checkLabel = this.getLocaleString("rememberPassword", "passwdmgr"); // XXX Like the original code, we can't deal with multiple // account selection. (bug 227632) diff --git a/mobile/android/locales/en-US/chrome/browser.properties b/mobile/android/locales/en-US/chrome/browser.properties index bd394e310297..d4d02673bc7a 100644 --- a/mobile/android/locales/en-US/chrome/browser.properties +++ b/mobile/android/locales/en-US/chrome/browser.properties @@ -138,15 +138,15 @@ openWebappsManage.allow=Allow openWebappsManage.dontAllow=Don't Allow openWebappsManage.wantsTo=%S wants to manage applications on your device. -# LOCALIZATION NOTE (password.savePassword): Label that will be used in +# LOCALIZATION NOTE (password.rememberPassword): Label that will be used in # site settings dialog. -password.savePassword=Save Password -# LOCALIZATION NOTE (password.save): This should match -# saveButton in passwordmgr.properties -password.save=Save -# LOCALIZATION NOTE (password.dontSave): This should match -# dontSaveButton in passwordmgr.properties -password.dontSave=Don't save +password.rememberPassword=Remember Password +# LOCALIZATION NOTE (password.remember): This should match +# promptRememberButtonText in passwordmgr.properties +password.remember=Remember +# LOCALIZATION NOTE (password.never): This should match +# promptNeverForSiteButtonText in passwordmgr.properties +password.never=Never # Bookmark List bookmarkList.desktop=Desktop Bookmarks diff --git a/mobile/locales/en-US/overrides/passwordmgr.properties b/mobile/locales/en-US/overrides/passwordmgr.properties index ba1348ad2393..933de16a7754 100644 --- a/mobile/locales/en-US/overrides/passwordmgr.properties +++ b/mobile/locales/en-US/overrides/passwordmgr.properties @@ -2,24 +2,39 @@ # 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/. -# 1st string is the username for the login, 2nd is the login's hostname. -# Note that long usernames may be truncated. -savePassword=Save password for "%1$S" on %2$S? -# String is the login's hostname -savePasswordNoUser=Save password on %S? -saveButton=Save -dontSaveButton=Don't save - -# String is the login's hostname -updatePassword=Update saved password for %S? -updatePasswordNoUser=Update saved password for this login? -updateButton=Update -dontUpdateButton=Don't update - -userSelectText=Please confirm which user you are changing the password for -passwordChangeTitle=Confirm Password Change - -# Strings used by PromptService.js -rememberPassword=Use Password Manager to remember this password. +rememberValue = Use Password Manager to remember this value. +rememberPassword = Use Password Manager to remember this password. +savePasswordTitle = Confirm +# 1st string is product name, 2nd is the username for the login, 3rd is the +# login's hostname. Note that long usernames may be truncated. +saveLoginText = Do you want %1$S to remember the password for "%2$S" on %3$S? +# 1st string is product name, 2nd is the login's hostname +saveLoginTextNoUsername = Do you want %1$S to remember this password on %2$S? +promptNotNowButtonText = Not Now +notifyBarNotNowButtonText = Not Now +notifyBarNotNowButtonAccessKey = +promptNeverForSiteButtonText = Never +notifyBarNeverForSiteButtonText = Never +notifyBarNeverForSiteButtonAccessKey = +promptRememberButtonText = Remember +notifyBarRememberButtonText = Remember +notifyBarRememberButtonAccessKey = +passwordChangeTitle = Confirm Password Change +passwordChangeText = Would you like to change the stored password for %S? +passwordChangeTextNoUser = Would you like to change the stored password for this login? +notifyBarChangeButtonText = Change +notifyBarChangeButtonAccessKey = +notifyBarDontChangeButtonText = Don't Change +notifyBarDontChangeButtonAccessKey = +userSelectText = Please confirm which user you are changing the password for +hidePasswords=Hide Passwords +hidePasswordsAccessKey=P +showPasswords=Show Passwords +showPasswordsAccessKey=P +noMasterPasswordPrompt=Are you sure you wish to show your passwords? +removeAllPasswordsPrompt=Are you sure you wish to remove all passwords? +removeAllPasswordsTitle=Remove all passwords +loginsSpielAll=Passwords for the following sites are stored on your computer: +loginsSpielFiltered=The following passwords match your search: username=Username password=Password