Bug 1638822 - convert openpgp strings to Fluent - jsm files continue. r=mkmelin a=wsmwk
authorKhushil Mistry <khushil324@gmail.com>
Thu, 11 Jun 2020 16:51:53 +0300
changeset 39401 02cafb5a0fe72a505f485010ec32977e80213b6d
parent 39400 decb78d3351b4bd0c43ef0b91ef01135f5778f71
child 39402 d2d84ac207536f6f672b861964909d1c70d46da0
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersmkmelin, wsmwk
bugs1638822
Bug 1638822 - convert openpgp strings to Fluent - jsm files continue. r=mkmelin a=wsmwk
mail/extensions/openpgp/content/modules/cryptoAPI/gnupg-keylist.jsm
mail/extensions/openpgp/content/modules/decryption.jsm
mail/extensions/openpgp/content/modules/filters.jsm
mail/extensions/openpgp/content/modules/filtersWrapper.jsm
mail/extensions/openpgp/content/modules/key.jsm
mail/extensions/openpgp/content/modules/keyObj.jsm
mail/extensions/openpgp/content/modules/keyRing.jsm
mail/extensions/openpgp/content/strings/enigmail.ftl
mail/extensions/openpgp/content/strings/enigmail.properties
mail/extensions/openpgp/content/ui/enigmailKeyImportInfo.js
mail/extensions/openpgp/content/ui/enigmailKeyManager.js
--- a/mail/extensions/openpgp/content/modules/cryptoAPI/gnupg-keylist.jsm
+++ b/mail/extensions/openpgp/content/modules/cryptoAPI/gnupg-keylist.jsm
@@ -28,16 +28,18 @@ const { EnigmailTrust } = ChromeUtils.im
 );
 const { EnigmailData } = ChromeUtils.import(
   "chrome://openpgp/content/modules/data.jsm"
 );
 const { EnigmailLocale } = ChromeUtils.import(
   "chrome://openpgp/content/modules/locale.jsm"
 );
 
+var l10n = new Localization(["messenger/openpgp/enigmail.ftl"], true);
+
 // field ID's of key list (as described in the doc/DETAILS file in the GnuPG distribution)
 const ENTRY_ID = 0;
 const KEY_TRUST_ID = 1;
 const KEY_SIZE_ID = 2;
 const KEY_ALGO_ID = 3;
 const KEY_ID = 4;
 const CREATED_ID = 5;
 const EXPIRY_ID = 6;
@@ -293,17 +295,17 @@ function extractSignatures(gpgKeyList, i
         }
         break;
       case "uid":
       case "uat":
         currUid = lineTokens[UID_ID];
         listObj[currUid] = {
           userId:
             lineTokens[ENTRY_ID] == "uat"
-              ? EnigmailLocale.getString("keyring.photo")
+              ? l10n.formatValueSync("keyring-photo")
               : EnigmailData.convertGpgToUnicode(lineTokens[USERID_ID]),
           rawUserId: lineTokens[USERID_ID],
           keyId,
           fpr,
           created: EnigmailTime.getDateTime(
             lineTokens[CREATED_ID],
             true,
             false
--- a/mail/extensions/openpgp/content/modules/decryption.jsm
+++ b/mail/extensions/openpgp/content/modules/decryption.jsm
@@ -47,16 +47,17 @@ const { EnigmailConstants } = ChromeUtil
   "chrome://openpgp/content/modules/constants.jsm"
 );
 const { EnigmailFuncs } = ChromeUtils.import(
   "chrome://openpgp/content/modules/funcs.jsm"
 );
 const { EnigmailCryptoAPI } = ChromeUtils.import(
   "chrome://openpgp/content/modules/cryptoAPI.jsm"
 );
+var l10n = new Localization(["messenger/openpgp/enigmail.ftl"], true);
 
 function statusObjectFrom(
   signatureObj,
   exitCodeObj,
   statusFlagsObj,
   keyIdObj,
   userIdObj,
   sigDetailsObj,
@@ -550,17 +551,17 @@ var EnigmailDecryption = {
     let attachmentHead = byteData.substr(0, 200);
     if (attachmentHead.match(/-----BEGIN PGP \w{5,10} KEY BLOCK-----/)) {
       // attachment appears to be a PGP key file
 
       if (
         EnigmailDialog.confirmDlg(
           parent,
           EnigmailLocale.getString("attachmentPgpKey", [displayName]),
-          EnigmailLocale.getString("keyMan.button.import"),
+          l10n.formatValueSync("key-man-button-import"),
           EnigmailLocale.getString("dlg.button.view")
         )
       ) {
         let preview = EnigmailKey.getKeyListFromKeyBlock(
           byteData,
           errorMsgObj,
           true,
           true,
--- a/mail/extensions/openpgp/content/modules/filters.jsm
+++ b/mail/extensions/openpgp/content/modules/filters.jsm
@@ -6,19 +6,16 @@
 
 "use strict";
 
 var EXPORTED_SYMBOLS = ["EnigmailFilters"];
 
 const { EnigmailLazy } = ChromeUtils.import(
   "chrome://openpgp/content/modules/lazy.jsm"
 );
-const { EnigmailLocale } = ChromeUtils.import(
-  "chrome://openpgp/content/modules/locale.jsm"
-);
 const { EnigmailCore } = ChromeUtils.import(
   "chrome://openpgp/content/modules/core.jsm"
 );
 const { EnigmailPersistentCrypto } = ChromeUtils.import(
   "chrome://openpgp/content/modules/persistentCrypto.jsm"
 );
 const { EnigmailLog } = ChromeUtils.import(
   "chrome://openpgp/content/modules/log.jsm"
@@ -49,16 +46,18 @@ const { EnigmailCompat } = ChromeUtils.i
 const { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 const getDialog = EnigmailLazy.loader("enigmail/dialog.jsm", "EnigmailDialog");
 
 var gNewMailListenerInitiated = false;
 
+var l10n = new Localization(["messenger/openpgp/enigmail.ftl"], true);
+
 /**
  * filter action for creating a decrypted version of the mail and
  * deleting the original mail at the same time
  */
 
 const filterActionMoveDecrypt = {
   apply(aMsgHdrs, aActionValue, aListener, aType, aMsgWindow) {
     EnigmailLog.DEBUG(
@@ -79,23 +78,22 @@ const filterActionMoveDecrypt = {
     );
   },
 
   isValidForType(type, scope) {
     return true;
   },
 
   validateActionValue(value, folder, type) {
-    getDialog().alert(
-      null,
-      EnigmailLocale.getString("filter.decryptMove.warnExperimental")
-    );
+    l10n.formatValue("filter-decrypt-move-warn-experimental").then(value => {
+      getDialog().alert(null, value);
+    });
 
     if (value === "") {
-      return EnigmailLocale.getString("filter.folderRequired");
+      return l10n.formatValueSync("filter-folder-required");
     }
 
     return null;
   },
 };
 
 /**
  * filter action for creating a decrypted copy of the mail, leaving the original
@@ -133,17 +131,17 @@ const filterActionCopyDecrypt = {
   validateActionValue(value, folder, type) {
     EnigmailLog.DEBUG(
       "filters.jsm: filterActionCopyDecrypt.validateActionValue(" +
         value +
         ")\n"
     );
 
     if (value === "") {
-      return EnigmailLocale.getString("filter.folderRequired");
+      return l10n.formatValueSync("filter-folder-required");
     }
 
     return null;
   },
 };
 
 /**
  * filter action for to encrypt a mail to a specific key
@@ -222,44 +220,49 @@ const filterActionEncrypt = {
     // we need it.
     EnigmailCore.getService();
     EnigmailKeyRing.getAllKeys();
 
     EnigmailLog.DEBUG(
       "filters.jsm: validateActionValue: Encrypt to: " + value + "\n"
     );
     if (value === "") {
-      return EnigmailLocale.getString("filter.keyRequired");
+      return l10n.formatValueSync("filter-key-required");
     }
 
     let keyObj = EnigmailKeyRing.getKeyById(value);
 
     if (keyObj === null) {
       EnigmailLog.DEBUG(
         "filters.jsm: failed to find key by id. Looking for uid.\n"
       );
       let keyId = EnigmailKeyRing.getValidKeyForRecipient(value);
       if (keyId) {
         keyObj = EnigmailKeyRing.getKeyById(keyId);
       }
     }
 
     if (keyObj === null) {
-      return EnigmailLocale.getString("filter.keyNotFound", [value]);
+      return l10n.formatValueSync("filter-key-not-found", {
+        desc: value,
+      });
     }
 
     if (!keyObj.secretAvailable) {
       // We warn but we allow it. There might be use cases where
       // thunderbird + enigmail is used as a gateway filter with
       // the secret not available on one machine and the decryption
       // is intended to happen on different systems.
-      getDialog().alert(
-        null,
-        EnigmailLocale.getString("filter.warn.keyNotSecret", [value])
-      );
+      l10n
+        .formatValue("filter-warn-key-not-secret", {
+          desc: value,
+        })
+        .then(value => {
+          getDialog().alert(null, value);
+        });
     }
 
     return null;
   },
 };
 
 function isPGPEncrypted(data) {
   // We only check the first mime subpart for application/pgp-encrypted.
@@ -295,17 +298,17 @@ function isPGPEncrypted(data) {
   return false;
 }
 
 /**
  * filter term for OpenPGP Encrypted mail
  */
 const filterTermPGPEncrypted = {
   id: EnigmailConstants.FILTER_TERM_PGP_ENCRYPTED,
-  name: EnigmailLocale.getString("filter.term.pgpencrypted.label"),
+  name: l10n.formatValueSync("filter-term-pgpencrypted-label"),
   needsBody: true,
   match(aMsgHdr, searchValue, searchOp) {
     var folder = aMsgHdr.folder;
     var stream = folder.getMsgInputStream(aMsgHdr, {});
 
     var messageSize = folder.hasMsgOffline(aMsgHdr.messageKey)
       ? aMsgHdr.offlineMessageSize
       : aMsgHdr.messageSize;
--- a/mail/extensions/openpgp/content/modules/filtersWrapper.jsm
+++ b/mail/extensions/openpgp/content/modules/filtersWrapper.jsm
@@ -8,28 +8,27 @@
 
 var EXPORTED_SYMBOLS = ["EnigmailFiltersWrapper"];
 
 var gEnigmailFilters = null;
 
 let { EnigmailConstants } = ChromeUtils.import(
   "chrome://openpgp/content/modules/constants.jsm"
 );
-let { EnigmailLocale } = ChromeUtils.import(
-  "chrome://openpgp/content/modules/locale.jsm"
-);
+
+var l10n = new Localization(["messenger/openpgp/enigmail.ftl"], true);
 
 /**
  * filter action for creating a decrypted version of the mail and
  * deleting the original mail at the same time
  */
 
 const filterActionMoveDecrypt = {
   id: EnigmailConstants.FILTER_MOVE_DECRYPT,
-  name: EnigmailLocale.getString("filter.decryptMove2.label"),
+  name: l10n.formatValueSync("filter-decrypt-move-label"),
   value: "movemessage",
   apply(aMsgHdrs, aActionValue, aListener, aType, aMsgWindow) {
     if (gEnigmailFilters) {
       gEnigmailFilters.moveDecrypt.apply(
         aMsgHdrs,
         aActionValue,
         aListener,
         aType,
@@ -64,17 +63,17 @@ const filterActionMoveDecrypt = {
 };
 
 /**
  * filter action for creating a decrypted copy of the mail, leaving the original
  * message untouched
  */
 const filterActionCopyDecrypt = {
   id: EnigmailConstants.FILTER_COPY_DECRYPT,
-  name: EnigmailLocale.getString("filter.decryptCopy2.label"),
+  name: l10n.formatValueSync("filter-decrypt-copy-label"),
   value: "copymessage",
   apply(aMsgHdrs, aActionValue, aListener, aType, aMsgWindow) {
     if (gEnigmailFilters) {
       gEnigmailFilters.copyDecrypt.apply(
         aMsgHdrs,
         aActionValue,
         aListener,
         aType,
@@ -108,17 +107,17 @@ const filterActionCopyDecrypt = {
   needsBody: true,
 };
 
 /**
  * filter action for to encrypt a mail to a specific key
  */
 const filterActionEncrypt = {
   id: EnigmailConstants.FILTER_ENCRYPT,
-  name: EnigmailLocale.getString("filter.encrypt2.label"),
+  name: l10n.formatValueSync("filter-encrypt-label"),
   value: "encryptto",
   apply(aMsgHdrs, aActionValue, aListener, aType, aMsgWindow) {
     if (gEnigmailFilters) {
       gEnigmailFilters.encrypt.apply(
         aMsgHdrs,
         aActionValue,
         aListener,
         aType,
--- a/mail/extensions/openpgp/content/modules/key.jsm
+++ b/mail/extensions/openpgp/content/modules/key.jsm
@@ -6,33 +6,31 @@
 
 "use strict";
 
 var EXPORTED_SYMBOLS = ["EnigmailKey"];
 
 const { EnigmailLog } = ChromeUtils.import(
   "chrome://openpgp/content/modules/log.jsm"
 );
-const { EnigmailLocale } = ChromeUtils.import(
-  "chrome://openpgp/content/modules/locale.jsm"
-);
 const { EnigmailFiles } = ChromeUtils.import(
   "chrome://openpgp/content/modules/files.jsm"
 );
 const { EnigmailLazy } = ChromeUtils.import(
   "chrome://openpgp/content/modules/lazy.jsm"
 );
 const getKeyRing = EnigmailLazy.loader(
   "enigmail/keyRing.jsm",
   "EnigmailKeyRing"
 );
 const getDialog = EnigmailLazy.loader("enigmail/dialog.jsm", "EnigmailDialog");
 const { EnigmailCryptoAPI } = ChromeUtils.import(
   "chrome://openpgp/content/modules/cryptoAPI.jsm"
 );
+var l10n = new Localization(["messenger/openpgp/enigmail.ftl"], true);
 
 var EnigmailKey = {
   /**
    * Format a key fingerprint
    * @fingerprint |string|  -  unformated OpenPGP fingerprint
    *
    * @return |string| - formatted string
    */
@@ -71,27 +69,30 @@ var EnigmailKey = {
    * message in case of failures.
    */
   importRevocationCert(keyId, keyBlockStr) {
     let key = getKeyRing().getKeyById(keyId);
 
     if (key) {
       if (key.keyTrust === "r") {
         // Key has already been revoked
-        getDialog().info(
-          null,
-          EnigmailLocale.getString("revokeKeyAlreadyRevoked", keyId)
-        );
+        l10n
+          .formatValue("revoke-key-already-revoked", {
+            keyId,
+          })
+          .then(value => {
+            getDialog().info(null, value);
+          });
       } else {
         let userId = key.userId + " - 0x" + key.keyId;
         if (
           !getDialog().confirmDlg(
             null,
-            EnigmailLocale.getString("revokeKeyQuestion", userId),
-            EnigmailLocale.getString("keyMan.button.revokeKey")
+            l10n.formatValueSync("revoke-key-question", { userId }),
+            l10n.formatValueSync("key-man-button-revoke-key")
           )
         ) {
           return;
         }
 
         let errorMsgObj = {};
         if (
           getKeyRing().importKey(
@@ -103,20 +104,23 @@ var EnigmailKey = {
             errorMsgObj
           ) > 0
         ) {
           getDialog().alert(null, errorMsgObj.value);
         }
       }
     } else {
       // Suitable key for revocation certificate is not present in keyring
-      getDialog().alert(
-        null,
-        EnigmailLocale.getString("revokeKeyNotPresent", keyId)
-      );
+      l10n
+        .formatValue("revoke-key-not-present", {
+          keyId,
+        })
+        .then(value => {
+          getDialog().alert(null, value);
+        });
     }
   },
 
   /**
    * Get details (key ID, UID) of the data contained in a OpenPGP key block
    *
    * @param keyBlockStr  String: the contents of one or more public keys
    * @param errorMsgObj  Object: obj.value will contain an error message in case of failures
--- a/mail/extensions/openpgp/content/modules/keyObj.jsm
+++ b/mail/extensions/openpgp/content/modules/keyObj.jsm
@@ -60,32 +60,31 @@ var EXPORTED_SYMBOLS = ["newEnigmailKeyO
      * clone
      * getMinimalPubKey
      * getVirtualKeySize
 */
 
 const { EnigmailLog } = ChromeUtils.import(
   "chrome://openpgp/content/modules/log.jsm"
 );
-const { EnigmailLocale } = ChromeUtils.import(
-  "chrome://openpgp/content/modules/locale.jsm"
-);
 const { EnigmailKey } = ChromeUtils.import(
   "chrome://openpgp/content/modules/key.jsm"
 );
 const { EnigmailFuncs } = ChromeUtils.import(
   "chrome://openpgp/content/modules/funcs.jsm"
 );
 const { EnigmailTime } = ChromeUtils.import(
   "chrome://openpgp/content/modules/time.jsm"
 );
 const { EnigmailCryptoAPI } = ChromeUtils.import(
   "chrome://openpgp/content/modules/cryptoAPI.jsm"
 );
 
+var l10n = new Localization(["messenger/openpgp/enigmail.ftl"], true);
+
 function newEnigmailKeyObj(keyData) {
   return new EnigmailKeyObj(keyData);
 }
 
 class EnigmailKeyObj {
   constructor(keyData) {
     this.keyId = "";
     this.expiry = "";
@@ -233,41 +232,41 @@ class EnigmailKeyObj {
    */
   getPubKeyValidity() {
     let retVal = {
       keyValid: false,
       reason: "",
     };
     if (this.keyTrust.search(/r/i) >= 0) {
       // public key revoked
-      retVal.reason = EnigmailLocale.getString("keyRing.pubKeyRevoked", [
-        this.userId,
-        "0x" + this.keyId,
-      ]);
+      retVal.reason = l10n.formatValueSync("key-ring-pub-key-revoked", {
+        userId: this.userId,
+        keyId: "0x" + this.keyId,
+      });
     } else if (this.keyTrust.search(/e/i) >= 0) {
       // public key expired
-      retVal.reason = EnigmailLocale.getString("keyRing.pubKeyExpired", [
-        this.userId,
-        "0x" + this.keyId,
-      ]);
+      retVal.reason = l10n.formatValueSync("key-ring-pub-key-expired", {
+        userId: this.userId,
+        keyId: "0x" + this.keyId,
+      });
     } else if (
       this.keyTrust.search(/d/i) >= 0 ||
       this.keyUseFor.search(/D/i) >= 0
     ) {
       // public key disabled
-      retVal.reason = EnigmailLocale.getString("keyRing.keyDisabled", [
-        this.userId,
-        "0x" + this.keyId,
-      ]);
+      retVal.reason = l10n.formatValueSync("key-ring-key-disabled", {
+        userId: this.userId,
+        keyId: "0x" + this.keyId,
+      });
     } else if (this.keyTrust.search(/i/i) >= 0) {
       // public key invalid
-      retVal.reason = EnigmailLocale.getString("keyRing.keyInvalid2", [
-        this.userId,
-        "0x" + this.keyId,
-      ]);
+      retVal.reason = l10n.formatValueSync("key-ring-key-invalid", {
+        userId: this.userId,
+        keyId: "0x" + this.keyId,
+      });
     } else {
       retVal.keyValid = true;
     }
 
     return retVal;
   }
 
   /**
@@ -280,30 +279,29 @@ class EnigmailKeyObj {
   getSigningValidity() {
     let retVal = this.getPubKeyValidity();
 
     if (!retVal.keyValid) {
       return retVal;
     }
 
     if (!this.secretAvailable) {
-      retVal.reason = EnigmailLocale.getString("keyRing.noSecretKey", [
-        this.userId,
-        "0x" + this.keyId,
-      ]);
       retVal.keyValid = false;
+      retVal.reason = l10n.formatValueSync("key-ring-no-secret-key", {
+        userId: this.userId,
+        keyId: "0x" + this.keyId,
+      });
     } else if (this.keyUseFor.search(/S/) < 0) {
       retVal.keyValid = false;
-
       if (this.keyTrust.search(/u/i) < 0) {
         // public key invalid
-        retVal.reason = EnigmailLocale.getString("keyRing.keyNotTrusted", [
-          this.userId,
-          "0x" + this.keyId,
-        ]);
+        retVal.reason = l10n.formatValueSync("key-ring-key-not-trusted", {
+          userId: this.userId,
+          keyId: "0x" + this.keyId,
+        });
       } else {
         let expired = 0,
           revoked = 0,
           unusable = 0,
           found = 0;
         // public key is valid; check for signing subkeys
         for (let sk in this.subKeys) {
           if (this.subKeys[sk].keyUseFor.search(/S/) >= 0) {
@@ -320,34 +318,46 @@ class EnigmailKeyObj {
               // found subkey usable
               ++found;
             }
           }
         }
 
         if (!found) {
           if (expired) {
-            retVal.reason = EnigmailLocale.getString(
-              "keyRing.signSubKeysExpired",
-              [this.userId, "0x" + this.keyId]
+            retVal.reason = l10n.formatValueSync(
+              "key-ring-sign-sub-keys-expired",
+              {
+                userId: this.userId,
+                keyId: "0x" + this.keyId,
+              }
             );
           } else if (revoked) {
-            retVal.reason = EnigmailLocale.getString(
-              "keyRing.signSubKeysRevoked",
-              [this.userId, "0x" + this.keyId]
+            retVal.reason = l10n.formatValueSync(
+              "key-ring-sign-sub-keys-revoked",
+              {
+                userId: this.userId,
+                keyId: "0x" + this.keyId,
+              }
             );
           } else if (unusable) {
-            retVal.reason = EnigmailLocale.getString(
-              "keyRing.signSubKeysUnusable",
-              [this.userId, "0x" + this.keyId]
+            retVal.reason = l10n.formatValueSync(
+              "key-ring-sign-sub-keys-unusable",
+              {
+                userId: this.userId,
+                keyId: "0x" + this.keyId,
+              }
             );
           } else {
-            retVal.reason = EnigmailLocale.getString(
-              "keyRing.pubKeyNotForSigning",
-              [this.userId, "0x" + this.keyId]
+            retVal.reason = l10n.formatValueSync(
+              "key-ring-pub-key-not-for-signing",
+              {
+                userId: this.userId,
+                keyId: "0x" + this.keyId,
+              }
             );
           }
         } else {
           retVal.keyValid = true;
         }
       }
     }
 
@@ -368,20 +378,20 @@ class EnigmailKeyObj {
       return retVal;
     }
 
     if (this.keyUseFor.search(/E/) < 0) {
       retVal.keyValid = false;
 
       if (this.keyTrust.search(/u/i) < 0) {
         // public key invalid
-        retVal.reason = EnigmailLocale.getString("keyRing.keyInvalid2", [
-          this.userId,
-          "0x" + this.keyId,
-        ]);
+        retVal.reason = l10n.formatValueSync("key-ring-key-invalid", {
+          userId: this.userId,
+          keyId: "0x" + this.keyId,
+        });
       } else {
         let expired = 0,
           revoked = 0,
           unusable = 0,
           found = 0;
         // public key is valid; check for encryption subkeys
 
         for (let sk in this.subKeys) {
@@ -399,34 +409,46 @@ class EnigmailKeyObj {
               // found subkey usable
               ++found;
             }
           }
         }
 
         if (!found) {
           if (expired) {
-            retVal.reason = EnigmailLocale.getString(
-              "keyRing.encSubKeysExpired",
-              [this.userId, "0x" + this.keyId]
+            retVal.reason = l10n.formatValueSync(
+              "key-ring-enc-sub-keys-expired",
+              {
+                userId: this.userId,
+                keyId: "0x" + this.keyId,
+              }
             );
           } else if (revoked) {
-            retVal.reason = EnigmailLocale.getString(
-              "keyRing.encSubKeysRevoked",
-              [this.userId, "0x" + this.keyId]
+            retVal.reason = l10n.formatValueSync(
+              "key-ring-enc-sub-keys-revoked",
+              {
+                userId: this.userId,
+                keyId: "0x" + this.keyId,
+              }
             );
           } else if (unusable) {
-            retVal.reason = EnigmailLocale.getString(
-              "keyRing.encSubKeysUnusable",
-              [this.userId, "0x" + this.keyId]
+            retVal.reason = l10n.formatValueSync(
+              "key-ring-enc-sub-keys-unusable",
+              {
+                userId: this.userId,
+                keyId: "0x" + this.keyId,
+              }
             );
           } else {
-            retVal.reason = EnigmailLocale.getString(
-              "keyRing.pubKeyNotForEncryption",
-              [this.userId, "0x" + this.keyId]
+            retVal.reason = l10n.formatValueSync(
+              "key-ring-pub-key-not-for-encryption",
+              {
+                userId: this.userId,
+                keyId: "0x" + this.keyId,
+              }
             );
           }
         } else {
           retVal.keyValid = true;
         }
       }
     }
 
--- a/mail/extensions/openpgp/content/modules/keyRing.jsm
+++ b/mail/extensions/openpgp/content/modules/keyRing.jsm
@@ -41,16 +41,18 @@ const { uidHelper } = ChromeUtils.import
 );
 
 const getDialog = EnigmailLazy.loader("enigmail/dialog.jsm", "EnigmailDialog");
 const getWindows = EnigmailLazy.loader(
   "enigmail/windows.jsm",
   "EnigmailWindows"
 );
 
+var l10n = new Localization(["messenger/openpgp/enigmail.ftl"], true);
+
 const DEFAULT_FILE_PERMS = 0o600;
 
 let gKeyListObj = null;
 let gKeyIndex = [];
 let gSubkeyIndex = [];
 let gLoadingKeys = false;
 
 /*
@@ -631,17 +633,17 @@ var EnigmailKeyRing = {
       );
     }
 
     if (isInteractive) {
       if (
         !getDialog().confirmDlg(
           parent,
           EnigmailLocale.getString("importKeyConfirm"),
-          EnigmailLocale.getString("keyMan.button.import")
+          l10n.formatValueSync("key-man-button-import")
         )
       ) {
         errorMsgObj.value = EnigmailLocale.getString("failCancel");
         return -1;
       }
     }
 
     if (limitedUids.length > 0) {
--- a/mail/extensions/openpgp/content/strings/enigmail.ftl
+++ b/mail/extensions/openpgp/content/strings/enigmail.ftl
@@ -228,15 +228,79 @@ wkd-message-body-process = This is an em
 
 # Strings in persistentCrypto.jsm
 converter-decrypt-body-failed = Could not decrypt message with subject\n{ $subject }.\nDo you want to retry with a different passphrase or do you want to skip the message?
 
 # Strings in gpg.jsm
 unknown-signing-alg = Unknown signing algorithm (ID: { $id })
 unknown-hash-alg = Unknown cryptographic hash (ID: { $id })
 
-#strings in keyUsability.jsm
+# Strings in keyUsability.jsm
 expiry-key-expires-soon = Your key { $desc } will expire in less than { $days } days.\n\nWe recommend that you create a new key pair and configure the corresponding accounts to use it.
 expiry-keys-expire-soon = Your following keys will expire in less than { $days } days:\n{ $desc }. We recommend that you create new keys and configure the corresponding accounts to use them.
 expiry-key-missing-owner-trust = Your secret key { $desc } has missing trust.\n\nWe recommend that you set "You rely on certifications" to "ultimate" in key properties.
 expiry-keys-missing-owner-trust = The following of your secret keys have missing trust.\n{ $desc }.\nWe recommend that you set "You rely on certifications" to "ultimate" in key properties.
 expiry-open-key-manager = Open OpenPGP Key Management
 expiry-open-key-properties = Open Key Properties
+
+# Strings filters.jsm
+filter-folder-required = You must select a target folder.
+filter-decrypt-move-warn-experimental = Warning - the filter action "Decrypt permanently" may lead to destroyed messages.\n\nWe strongly recommend that you first try the "Create decrypted Copy" filter, test the result carefully, and only start using this filter once you are satisified with the result.
+filter-term-pgpencrypted-label = OpenPGP Encrypted
+filter-key-required = You must select a recipient key.
+filter-key-not-found = Could not find an encryption key for '{ $desc }'.
+filter-warn-key-not-secret = Warning - the filter action "Encrypt to key" replaces the recipients.\n\nIf you do not have the secret key for '{ $desc }' you will no longer be able to read the emails.
+
+#Strings filtersWrapper.jsm
+filter-decrypt-move-label = Decrypt permanently (OpenPGP)
+filter-decrypt-copy-label = Create decrypted Copy (OpenPGP)
+filter-encrypt-label = Encrypt to key (OpenPGP)
+
+# Strings in enigmailKeyImportInfo.js
+import-info-title =
+    .title = SUCCESS! Keys imported
+import-info-bits = Bits
+import-info-created = Created
+import-info-fpr = Fingerprint
+import-info-details = View Details and manage key acceptance
+import-info-no-keys = No keys imported.
+
+# Strings in enigmailKeyManager.js
+import-from-clip = Do you want to import some key(s) from clipboard?
+import-from-url = Download public key from this URL:
+copy-to-clipbrd-failed = Could not copy the selected key(s) to the clipboard.
+copy-to-clipbrd-ok = Key(s) copied to clipboard
+delete-secret-key = WARNING: You are about to delete a secret key!\nIf you delete your secret key, you will no longer be able to decrypt any messages encrypted for that key, nor will you be able to revoke it.\n\nDo you really want to delete BOTH, the secret key and the public key\n'{ $userId }'?
+delete-mix = WARNING: You are about to delete secret keys!\nIf you delete your secret key, you will no longer be able to decrypt any messages encrypted for that key.\n\nDo you really want to delete BOTH, the selected secret and public keys?
+delete-pub-key = Do you want to delete the public key\n'{ $userId }'?
+delete-selected-pub-key = Do you want to delete the public keys?
+refresh-all-question = You did not select any key. Would you like to refresh ALL keys?
+key-man-button-export-sec-key = Export &Secret Keys
+key-man-button-export-pub-key = Export &Public Keys Only
+key-man-button-refresh-all = &Refresh All Keys
+
+# Strings in keyObj.jsm
+key-ring-pub-key-revoked = The key { $userId } (key ID { $keyId }) is revoked.
+key-ring-pub-key-expired = The key { $userId } (key ID { $keyId }) has expired.
+key-ring-key-disabled = The key { $userId } (key ID { $keyId }) is disabled; it cannot be used.
+key-ring-key-invalid = The key { $userId } (key ID { $keyId }) is not valid. Please consider verifying it correctly.
+key-ring-key-not-trusted=The key { $userId } (key ID { $keyId }) is not trusted enough. Please set the trust level of your key to "ultimate" to use it for signing.
+key-ring-no-secret-key = You do not seem to have the secret key for { $userId } (key ID { $keyId }) on your keyring; you cannot use the key for signing.
+key-ring-pub-key-not-for-signing = The key { $userId } (key ID { $keyId }) cannot be used for signing.
+key-ring-pub-key-not-for-encryption = The key { $userId } (key ID { $keyId }) cannot be used for encryption.
+key-ring-sign-sub-keys-revoked = All signing-subkeys of key { $userId } (key ID { $keyId }) are revoked.
+key-ring-sign-sub-keys-expired = All signing-subkeys of key { $userId } (key ID { $keyId }) have expired.
+key-ring-sign-sub-keys-unusable = All signing-subkeys of key { $userId } (key ID { $keyId }) are revoked, expired or otherwise unusable.
+key-ring-enc-sub-keys-revoked = All encryption subkeys of key { $userId } (key ID { $keyId }) are revoked.
+key-ring-enc-sub-keys-expired = All encryption subkeys of key { $userId } (key ID { $keyId }) have expired.
+key-ring-enc-sub-keys-unusable = All encryption subkeys of key { $userId } (key ID { $keyId }) are revoked, expired or otherwise unusable.
+
+# Strings in gnupg-keylist.jsm
+keyring-photo = Photo
+
+# Strings in key.jsm
+revoke-key-question = You are about to revoke the key '{ $userId }'.\n\nYou will no longer be able to sign with this key, and once distributed, others will no longer be able to encrypt with that key. You can still use the key to decrypt old messages.\n\nDo you want to proceed?
+revoke-key-not-present = You have no key (0x{ $keyId }) which matches this revocation certificate!\n\nIf you have lost your key, you must import it (e.g. from a keyserver) before importing the revocation certificate!
+revoke-key-already-revoked = The key 0x{ $keyId } has already been revoked.
+key-man-button-revoke-key = &Revoke Key
+
+# Strings in keyRing.jsm & decryption.jsm
+key-man-button-import = &Import
--- a/mail/extensions/openpgp/content/strings/enigmail.properties
+++ b/mail/extensions/openpgp/content/strings/enigmail.properties
@@ -393,46 +393,28 @@ exportSecretKey=Do you want to include t
 saveKeysOK=The keys were successfully saved
 saveKeysFailed=Saving the keys failed
 importKeysFailed=Importing the keys failed
 specificPubKeyFilename=%1$S (0x%2$S) pub
 specificPubSecKeyFilename=%1$S (0x%2$S) pub-sec
 defaultPubKeyFilename=Exported-public-keys
 defaultPubSecKeyFilename=Exported-public-and-secret-keys
 
-sendKeysOk=Key(s) sent successfully
-sendKeysFailed=Sending of keys failed
-receiveKeysOk=Key(s) updated successfully
-receiveKeysFailed=Downloading of keys failed
+### sendKeysOk=Key(s) sent successfully
+### sendKeysFailed=Sending of keys failed
+### receiveKeysOk=Key(s) updated successfully
+### receiveKeysFailed=Downloading of keys failed
 ### keyUpload.verifyEmails=The keyserver will send you an email for each email address of your uploaded key. To confirm publication of your key, you'll need to click on the link in each of the emails you'll receive.
 
-importFromClip=Do you want to import some key(s) from clipboard?
-importFromUrl=Download public key from this URL:
-copyToClipbrdFailed=Could not copy the selected key(s) to the clipboard.
-copyToClipbrdOK=Key(s) copied to clipboard
-
-deleteSecretKey=WARNING: You are about to delete a secret key!\nIf you delete your secret key, you will no longer be able to decrypt any messages encrypted for that key, nor will you be able to revoke it.\n\nDo you really want to delete BOTH, the secret key and the public key\n'%S'?
-deleteMix=WARNING: You are about to delete secret keys!\nIf you delete your secret key, you will no longer be able to decrypt any messages encrypted for that key.\n\nDo you really want to delete BOTH, the selected secret and public keys?
-deletePubKey=Do you want to delete the public key\n'%S'?
-deleteSelectedPubKey=Do you want to delete the public keys?
 ### deleteKeyFailed=The key could not be deleted.
-revokeKeyQuestion=You are about to revoke the key '%S'.\n\nYou will no longer be able to sign with this key, and once distributed, others will no longer be able to encrypt with that key. You can still use the key to decrypt old messages.\n\nDo you want to proceed?
-revokeKeyOk=The key has been revoked. If your key is available on a key server, it is recommended to re-upload it, so that others can see the revocation.
+### revokeKeyOk=The key has been revoked. If your key is available on a key server, it is recommended to re-upload it, so that others can see the revocation.
 ### revokeKeyFailed=The key could not be revoked.
-revokeKeyNotPresent=You have no key (0x%S) which matches this revocation certificate!\n\nIf you have lost your key, you must import it (e.g. from a keyserver) before importing the revocation certificate!
-revokeKeyAlreadyRevoked=The key 0x%S has already been revoked.
-refreshAllQuestion=You did not select any key. Would you like to refresh ALL keys?
 ### refreshKeyServiceOn.warn=Warning: Your keys are currently being refreshed in the background as safely as possible.\nRefreshing all your keys at once will unnecessarily reveal information about you.\nDo you really want to do this?
 ### refreshKey.warn=Warning: depending on the number of keys and the connection speed, refreshing all keys could be quite a lengthy process!
 ### downloadContactsKeys.importFrom=Import contacts from address book '%S'?
-keyMan.button.exportSecKey=Export &Secret Keys
-keyMan.button.exportPubKey=Export &Public Keys Only
-keyMan.button.import=&Import
-keyMan.button.refreshAll=&Refresh All Keys
-keyMan.button.revokeKey=&Revoke Key
 
 ### keylist.noOtherUids=Has no other identities
 ### keylist.hasOtherUids=Also known as
 ### keylist.noPhotos=No photo available
 ### keylist.hasPhotos=Photos
 
 ### keyMan.addphoto.filepicker.title=Select photo to add
 ### keyMan.addphoto.warnLargeFile=The file you have chosen is larger than 25 kB.\nIt is not recommended to add very large files as it causes very large keys.
@@ -444,24 +426,16 @@ keyMan.button.revokeKey=&Revoke Key
 
 # Strings in enigmailManageUidDlg.xhtml
 ### changePrimUidFailed=Changing the primary User ID failed
 ### changePrimUidOK=The primary user ID was changed successfully
 ### revokeUidFailed=Revoking the user ID %S failed
 ### revokeUidOK=User ID %S was revoked successfully. If your key is available on a key server, it is recommended to re-upload it, so that others can see the revocation.
 ### revokeUidQuestion=Do you really want to revoke the user ID %S?
 
-# Strings in enigmailKeyImportInfo.xhtml
-importInfoTitle=SUCCESS! Keys imported
-importInfoBits=Bits
-importInfoCreated=Created
-importInfoFpr=Fingerprint
-importInfoDetails2=View Details and manage key acceptance
-importInfoNoKeys=No keys imported.
-
 # Strings in enigmailGenCardKey.xhtml
 ### keygen.started=Please wait while the key is being generated ....
 ### keygen.completed=Key Generated. The new Key ID is: 0x%S
 ### keygen.keyBackup=The key is backed up as %S
 ### keygen.passRequired=Please specify a passphrase if you want to create a backup copy of your key outside your SmartCard.
 
 # Strings in enigmailSetCardPin.xhtml
 ### cardPin.processFailed=Failed to change PIN
@@ -492,48 +466,20 @@ importInfoNoKeys=No keys imported.
 # Strings in enigmailCardDetails.js
 ### Carddetails.NoASCII=OpenPGP Smartcards only support ASCII characters in Firstname/Name.
 
 # network error types
 ### errorType.SecurityCertificate=The security certificate presented by the web service is not valid.
 ### errorType.SecurityProtocol=The security protocol used by the web service is unknown.
 ### errorType.Network=A network error has occurred.
 
-# filter stuff
-filter.folderRequired=You must select a target folder.
-filter.decryptMove2.label=Decrypt permanently (OpenPGP)
-filter.decryptCopy2.label=Create decrypted Copy (OpenPGP)
-filter.decryptMove.warnExperimental=Warning - the filter action "Decrypt permanently" may lead to destroyed messages.\n\nWe strongly recommend that you first try the "Create decrypted Copy" filter, test the result carefully, and only start using this filter once you are satisified with the result.
-filter.term.pgpencrypted.label=OpenPGP Encrypted
-filter.encrypt2.label=Encrypt to key (OpenPGP)
-filter.keyRequired=You must select a recipient key.
-filter.keyNotFound=Could not find an encryption key for '%S'.
-filter.warn.keyNotSecret=Warning - the filter action "Encrypt to key" replaces the recipients.\n\nIf you do not have the secret key for '%S' you will no longer be able to read the emails.
-
 ### converter.decryptAtt.failed=Could not decrypt attachment '%1$S'\nof message with subject\n'%2$S'.\nDo you want to retry with a different passphrase or do you want to skip the message?
 
 ### saveLogFile.title=Save Log File
 
-# strings in keyRing.jsm
-keyring.photo=Photo
-keyRing.pubKeyRevoked=The key %1$S (key ID %2$S) is revoked.
-keyRing.pubKeyExpired=The key %1$S (key ID %2$S) has expired.
-keyRing.pubKeyNotForSigning=The key %1$S (key ID %2$S) cannot be used for signing.
-keyRing.pubKeyNotForEncryption=The key %1$S (key ID %2$S) cannot be used for encryption.
-keyRing.keyDisabled=The key %1$S (key ID %2$S) is disabled; it cannot be used.
-keyRing.keyNotTrusted=The key %1$S (key ID %2$S) is not trusted enough. Please set the trust level of your key to "ultimate" to use it for signing.
-keyRing.keyInvalid2=The key %1$S (key ID %2$S) is not valid. Please consider verifying it correctly.
-keyRing.signSubKeysRevoked=All signing-subkeys of key %1$S (key ID %2$S) are revoked.
-keyRing.signSubKeysExpired=All signing-subkeys of key %1$S (key ID %2$S) have expired.
-keyRing.signSubKeysUnusable=All signing-subkeys of key %1$S (key ID %2$S) are revoked, expired or otherwise unusable.
-keyRing.encSubKeysRevoked=All encryption subkeys of key %1$S (key ID %2$S) are revoked.
-keyRing.encSubKeysExpired=All encryption subkeys of key %1$S (key ID %2$S) have expired.
-keyRing.noSecretKey=You do not seem to have the secret key for %1$S (key ID %2$S) on your keyring; you cannot use the key for signing.
-keyRing.encSubKeysUnusable=All encryption subkeys of key %1$S (key ID %2$S) are revoked, expired or otherwise unusable.
-
 #strings in exportSettingsWizard.js
 ### cannotWriteToFile=Cannot save to file '%S'. Please select a different file.
 ### dataExportError=An error occurred during exporting your data.
 ### specifyExportFile=Specify file name for exporting
 ### homedirParamNotSUpported=Additional parameters that configure paths such as --homedir and --keyring are not supported for exporting/restoring your settings. Please use alternative methods such as setting the environment variable GNUPGHOME.
 
 #strings in gpgAgent.jsm
 ### gpghomedir.notexists=The directory '%S' containing your OpenPGP keys does not exist and cannot be created.
--- a/mail/extensions/openpgp/content/ui/enigmailKeyImportInfo.js
+++ b/mail/extensions/openpgp/content/ui/enigmailKeyImportInfo.js
@@ -30,17 +30,17 @@ function onLoad() {
   var dlg = document.getElementById("enigmailKeyImportInfo");
 
   let i, keys;
 
   dlg.getButton("help").setAttribute("hidden", "true");
   dlg.getButton("cancel").setAttribute("hidden", "true");
   dlg.getButton("extra1").setAttribute("hidden", "true");
   dlg.getButton("extra2").setAttribute("hidden", "true");
-  dlg.setAttribute("title", EnigmailLocale.getString("importInfoTitle"));
+  document.l10n.setAttributes(dlg, "import-info-title");
 
   if (window.screen.width > 500) {
     dlg.setAttribute("maxwidth", window.screen.width - 150);
   }
 
   if (window.screen.height > 300) {
     dlg.setAttribute("maxheight", window.screen.height - 100);
   }
@@ -88,18 +88,20 @@ function onLoad() {
       }
       keysRow.appendChild(keys[i]);
     }
 
     keysGrid.appendChild(keysRows);
     keysGrid.appendChild(keysCols);
     keysInfoBox.appendChild(keysGrid);
   } else {
-    EnigmailDialog.alert(window, EnigmailLocale.getString("importInfoNoKeys"));
-    EnigmailEvents.dispatchEvent(window.close, 0);
+    document.l10n.formatValue("import-info-no-keys").then(value => {
+      EnigmailDialog.alert(window, value);
+      EnigmailEvents.dispatchEvent(window.close, 0);
+    });
     return;
   }
 
   EnigmailEvents.dispatchEvent(resizeDlg, 0);
 }
 
 function buildKeyGroupBox(keyObj) {
   let i,
@@ -127,21 +129,19 @@ function buildKeyGroupBox(keyObj) {
     fprRow1 = document.createXULElement("row"),
     fprRow2 = document.createXULElement("row");
 
   groupBox.setAttribute("class", "enigmailGroupbox");
   userid.setAttribute("value", keyObj.userId);
   userid.setAttribute("class", "enigmailKeyImportUserId");
   vbox.setAttribute("align", "start");
   //caption.setAttribute("class", "enigmailKeyImportCaption");
-  infoLabelH1.setAttribute("value", EnigmailLocale.getString("importInfoBits"));
-  infoLabelH2.setAttribute(
-    "value",
-    EnigmailLocale.getString("importInfoCreated")
-  );
+  document.l10n.setAttributes(infoLabelH1, "import-info-bits");
+
+  document.l10n.setAttributes(infoLabelH2, "import-info-created");
   infoLabelH3.setAttribute("value", "");
   infoLabelB1.setAttribute("value", keyObj.keySize);
   infoLabelB2.setAttribute("value", keyObj.created);
 
   infoRowHead.appendChild(infoLabelH1);
   infoRowHead.appendChild(infoLabelH2);
   infoRowHead.appendChild(infoLabelH3);
   infoRowHead.setAttribute("class", "enigmailKeyImportHeader");
@@ -149,17 +149,18 @@ function buildKeyGroupBox(keyObj) {
   infoRowBody.appendChild(infoLabelB2);
   infoRows.appendChild(infoRowHead);
   infoRows.appendChild(infoRowBody);
   infoColumns.appendChild(infoColId);
   infoColumns.appendChild(infoColDate);
   infoGrid.appendChild(infoColumns);
   infoGrid.appendChild(infoRows);
 
-  fprLabel.setAttribute("value", EnigmailLocale.getString("importInfoFpr"));
+  document.l10n.setAttributes(fprLabel, "import-info-fpr");
+
   fprLabel.setAttribute("class", "enigmailKeyImportHeader");
   for (i = 0; i < keyObj.fpr.length; i += 4) {
     var label = document.createXULElement("label");
     label.setAttribute("value", keyObj.fpr.substr(i, 4));
     if (i < keyObj.fpr.length / 2) {
       fprColumns.appendChild(document.createXULElement("column"));
       fprRow1.appendChild(label);
     } else {
@@ -173,20 +174,17 @@ function buildKeyGroupBox(keyObj) {
   fprGrid.appendChild(fprRows);
   //vbox.appendChild(caption);
   groupBox.appendChild(vbox);
   groupBox.appendChild(userid);
   groupBox.appendChild(infoGrid);
   groupBox.appendChild(fprLabel);
   groupBox.appendChild(fprGrid);
 
-  infoLabelB3.setAttribute(
-    "value",
-    EnigmailLocale.getString("importInfoDetails2")
-  );
+  document.l10n.setAttributes(infoLabelB3, "import-info-details");
   infoLabelB3.setAttribute("keyid", keyObj.keyId);
   infoLabelB3.setAttribute("class", "enigmailKeyImportDetails");
   groupBox.appendChild(infoLabelB3);
 
   return groupBox;
 }
 
 function resizeDlg() {
--- a/mail/extensions/openpgp/content/ui/enigmailKeyManager.js
+++ b/mail/extensions/openpgp/content/ui/enigmailKeyManager.js
@@ -54,16 +54,18 @@ var { EnigmailSearchCallback } = ChromeU
 );
 var { EnigmailCompat } = ChromeUtils.import(
   "chrome://openpgp/content/modules/compat.jsm"
 );
 var { EnigmailCryptoAPI } = ChromeUtils.import(
   "chrome://openpgp/content/modules/cryptoAPI.jsm"
 );
 
+var l10n = new Localization(["messenger/openpgp/enigmail.ftl"], true);
+
 const INPUT = 0;
 const RESULT = 1;
 
 var gUserList;
 var gKeyList;
 var gEnigLastSelectedKeys = null;
 var gKeySortList = null;
 var gSearchInput = null;
@@ -301,51 +303,55 @@ function enigmailDeleteKey() {
   }
 
   if (keyList.length == 1) {
     // one key selected
     var userId = gKeyList[keyList[0]].userId;
     if (gKeyList[keyList[0]].secretAvailable) {
       if (
         !EnigConfirm(
-          EnigGetString("deleteSecretKey", userId),
+          l10n.formatValueSync("delete-secret-key", {
+            userId,
+          }),
           EnigGetString("dlg.button.delete")
         )
       ) {
         return;
       }
       deleteSecret = true;
     } else if (
       !EnigConfirm(
-        EnigGetString("deletePubKey", userId),
+        l10n.formatValueSync("delete-pub-key", {
+          userId,
+        }),
         EnigGetString("dlg.button.delete")
       )
     ) {
       return;
     }
   } else {
     // several keys selected
     for (var i = 0; i < keyList.length; i++) {
       if (gKeyList[keyList[i]].secretAvailable) {
         deleteSecret = true;
       }
     }
 
     if (deleteSecret) {
       if (
         !EnigConfirm(
-          EnigGetString("deleteMix"),
+          l10n.formatValueSync("delete-mix"),
           EnigGetString("dlg.button.delete")
         )
       ) {
         return;
       }
     } else if (
       !EnigConfirm(
-        EnigGetString("deleteSelectedPubKey"),
+        l10n.formatValueSync("deleteSelectedPubKey"),
         EnigGetString("dlg.button.delete")
       )
     ) {
       return;
     }
   }
 
   const cApi = EnigmailCryptoAPI();
@@ -587,18 +593,18 @@ function enigmailExportKeys() {
   }
 
   var exportSecretKey = false;
   if (secretFound) {
     // double check that also the pivate keys shall be exportet
     var r = EnigmailDialog.msgBox(window, {
       msgtext: EnigGetString("exportSecretKey"),
       dialogTitle: EnigGetString("enigConfirm2"),
-      button1: EnigGetString("keyMan.button.exportPubKey"),
-      button2: EnigGetString("keyMan.button.exportSecKey"),
+      button1: l10n.formatValueSync("key-man-button-export-pub-key"),
+      button2: l10n.formatValueSync("key-man-button-export-sec-key"),
       cancelButton: ":cancel",
       iconType: EnigmailConstants.ICONTYPE_QUESTION,
     });
     switch (r) {
       case 0: // export pub key only
         break;
       case 1: // export secret key
         exportSecretKey = true;
@@ -719,18 +725,18 @@ function enigGetClipboard() {
 function enigmailImportFromClipbrd() {
   var enigmailSvc = GetEnigmailSvc();
   if (!enigmailSvc) {
     return;
   }
 
   if (
     !EnigConfirm(
-      EnigGetString("importFromClip"),
-      EnigGetString("keyMan.button.import")
+      l10n.formatValueSync("import-from-clip"),
+      l10n.formatValueSync("key-man-button-import")
     )
   ) {
     return;
   }
 
   var cBoardContent = enigGetClipboard();
   var errorMsgObj = {};
   var preview = EnigmailKey.getKeyListFromKeyBlock(
@@ -817,19 +823,23 @@ function enigmailCopyToClipbrd() {
       EnigGetString("copyToClipbrdFailed") + "\n\n" + errorMsgObj.value
     );
     return;
   }
   if (EnigmailClipboard.setClipboardContent(keyData)) {
     EnigmailLog.DEBUG(
       "enigmailKeyManager.js: enigmailImportFromClipbrd: set clipboard data\n"
     );
-    EnigmailDialog.info(window, EnigGetString("copyToClipbrdOK"));
+    l10n.formatValue("copy-to-clipbrd-ok").then(value => {
+      EnigmailDialog.info(window, value);
+    });
   } else {
-    EnigAlert(EnigGetString("copyToClipbrdFailed"));
+    l10n.formatValue("copy-to-clipbrd-failed").then(value => {
+      EnigAlert(value);
+    });
   }
 }
 
 /*
 function enigmailSearchKey() {
   var inputObj = {
     searchList: null,
   };
@@ -1053,17 +1063,21 @@ function enigmailReceiveKeyCb(exitCode, 
 }
 */
 
 function enigmailImportKeysFromUrl() {
   var value = {
     value: "",
   };
   if (
-    EnigmailDialog.promptValue(window, EnigGetString("importFromUrl"), value)
+    EnigmailDialog.promptValue(
+      window,
+      l10n.formatValueSync("import-from-url"),
+      value
+    )
   ) {
     var p = new Promise(function(resolve, reject) {
       var cbFunc = function(data) {
         EnigmailLog.DEBUG("enigmailImportKeysFromUrl: _cbFunc()\n");
         var errorMsgObj = {};
 
         var preview = EnigmailKey.getKeyListFromKeyBlock(
           data,
@@ -1213,18 +1227,18 @@ function accessKeyServer(accessType, cal
   for (let i = 0; i < selKeyList.length; i++) {
     keyList.push(gKeyList[selKeyList[i]]);
   }
 
   if (accessType !== EnigmailConstants.REFRESH_KEY && selKeyList.length === 0) {
     if (
       EnigmailDialog.confirmDlg(
         window,
-        EnigmailLocale.getString("refreshAllQuestion"),
-        EnigmailLocale.getString("keyMan.button.refreshAll")
+        l10n.formatValueSync("refresh-all-question"),
+        l10n.formatValueSync("key-man-button-refresh-all")
       )
     ) {
       accessType = EnigmailConstants.DOWNLOAD_KEY;
       EnigmailDialog.alertPref(
         window,
         EnigmailLocale.getString("refreshKey.warn"),
         "warnRefreshAll"
       );