// 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 = [];
_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)
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 = [];
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;
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
// 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);
},
"Copy selected messages",
function (args) { mail._moveOrCopy(true, args.literalArg); },
{
- argCount: 1,
+ argCount: "1",
completer: function (context) completion.mailFolder(context),
literal: 0
});
"Move selected messages",
function (args) { mail._moveOrCopy(false, args.literalArg); },
{
- argCount: 1,
+ argCount: "1",
completer: function (context) completion.mailFolder(context),
literal: 0
});