X-Git-Url: https://git.donarmstrong.com/?p=dactyl.git;a=blobdiff_plain;f=teledactyl%2Fcontent%2Fmail.js;h=3b67b4500441d7e808e0ecd6935922e6fbdcb09f;hp=ff01820c6eb57555861fae186f3cf972644c8612;hb=70740024f9c028c1fd63e1a1850ab062ff956054;hpb=718c614c183350706466e22939d0101ca4c87efe diff --git a/teledactyl/content/mail.js b/teledactyl/content/mail.js index ff01820..3b67b45 100644 --- a/teledactyl/content/mail.js +++ b/teledactyl/content/mail.js @@ -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 });