]> git.donarmstrong.com Git - dactyl.git/blobdiff - teledactyl/content/mail.js
Import 1.0b7.1 supporting Firefox up to 8.*
[dactyl.git] / teledactyl / content / mail.js
index ff01820c6eb57555861fae186f3cf972644c8612..3b67b4500441d7e808e0ecd6935922e6fbdcb09f 100644 (file)
@@ -4,7 +4,7 @@
 // given in the LICENSE.txt file included with this file.
 "use strict";
 
-const Mail = Module("mail", {
+var Mail = Module("mail", {
     init: function init() {
         // used for asynchronously selecting messages after wrapping folders
         this._selectMessageKeys = [];
@@ -70,9 +70,9 @@ const Mail = Module("mail", {
     _moveOrCopy: function (copy, destinationFolder, operateOnThread) {
         let folders = mail.getFolders(destinationFolder);
         if (folders.length == 0)
-            return void dactyl.echoerr("Exxx: No matching folder for " + destinationFolder);
+            return void dactyl.echoerr(_("addressbook.noMatchingFolder", destinationFolder));
         else if (folders.length > 1)
-            return dactyl.echoerr("Exxx: More than one match for " + destinationFolder);
+            return dactyl.echoerr(_("addressbook.multipleFolderMatches", destinationFolder));
 
         let count = gDBView.selection.count;
         if (!count)
@@ -129,7 +129,7 @@ const Mail = Module("mail", {
 
     get currentFolder() gFolderTreeView.getSelectedFolders()[0],
 
-    /** @property {nsISmtpServer[]} The list of configured SMTP servers. */
+    /** @property {[nsISmtpServer]} The list of configured SMTP servers. */
     get smtpServers() {
         let servers = services.smtp.smtpServers;
         let res = [];
@@ -168,7 +168,7 @@ const Mail = Module("mail", {
                     let url = args.attachments.pop();
                     let file = io.getFile(url);
                     if (!file.exists())
-                        return void dactyl.echoerr("Exxx: Could not attach file `" + url + "'", commandline.FORCE_SINGLELINE);
+                        return void dactyl.echoerr(_("mail.cantAttachFile", url), commandline.FORCE_SINGLELINE);
 
                     attachment = Cc["@mozilla.org/messengercompose/attachment;1"].createInstance(Ci.nsIMsgAttachment);
                     attachment.url = "file://" + file.path;
@@ -402,7 +402,7 @@ const Mail = Module("mail", {
 
                 let folder = mail.getFolders(arg, true, true)[count];
                 if (!folder)
-                    dactyl.echoerr("Exxx: Folder \"" + arg + "\" does not exist");
+                    dactyl.echoerr(_("command.goto.folderNotExist", arg));
                 else if (dactyl.forceNewTab)
                     MsgOpenNewTabForFolder(folder.URI);
                 else
@@ -434,7 +434,7 @@ const Mail = Module("mail", {
 
                 // TODO: is there a better way to check for validity?
                 if (addresses.some(function (recipient) !(/\S@\S+\.\S/.test(recipient))))
-                    return void dactyl.echoerr("Exxx: Invalid e-mail address");
+                    return void dactyl.echoerr(_("command.mail.invalidEmailAddress"));
 
                 mail.composeNewMail(mailargs);
             },
@@ -453,7 +453,7 @@ const Mail = Module("mail", {
             "Copy selected messages",
             function (args) { mail._moveOrCopy(true, args.literalArg); },
             {
-                argCount: 1,
+                argCount: "1",
                 completer: function (context) completion.mailFolder(context),
                 literal: 0
             });
@@ -462,7 +462,7 @@ const Mail = Module("mail", {
             "Move selected messages",
             function (args) { mail._moveOrCopy(false, args.literalArg); },
             {
-                argCount: 1,
+                argCount: "1",
                 completer: function (context) completion.mailFolder(context),
                 literal: 0
             });