1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 13:04:12 +01:00

Move some more message strings to the properties file.

This commit is contained in:
Doug Kearns
2011-03-06 03:15:01 +11:00
parent 87a756718d
commit cae269fd32
13 changed files with 85 additions and 54 deletions

View File

@@ -475,7 +475,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
let res = true; let res = true;
for (let [command, args] in commands.parseCommands(str.replace(/^'(.*)'$/, "$1"))) { for (let [command, args] in commands.parseCommands(str.replace(/^'(.*)'$/, "$1"))) {
if (command === null) if (command === null)
throw FailedAssertion("E492: Not a " + config.appName + " command: " + args.commandString); throw FailedAssertion(_("dactyl.notCommand", config.appName, args.commandString));
res = res && command.execute(args, modifiers); res = res && command.execute(args, modifiers);
} }

View File

@@ -1,6 +1,12 @@
# TODO: normalise this debacle of Vim legacy messages
# : are we losing the error code prefixes? --djk
abbrev.noSuch = No such abbreviation abbrev.noSuch = No such abbreviation
abbrev.none = No abbreviations found abbrev.none = No abbreviations found
addon.check-1 = Checking updates for addons: %S
addon.cantInstallDir-1 = Cannot install a directory: %S
autocmd.executing-2 = Executing %S Auto commands for %S autocmd.executing-2 = Executing %S Auto commands for %S
autocmd.autocommand-1 = autocommand %S autocmd.autocommand-1 = autocommand %S
autocmd.noMatching = No matching autocommands autocmd.noMatching = No matching autocommands
@@ -36,12 +42,24 @@ command.invalidOpt-1 = Invalid option: %S
command.invalidOptArg-2 = Invalid argument for option %S: %S command.invalidOptArg-2 = Invalid argument for option %S: %S
command.invalidOptTypeArg-3 = Invalid argument for %S option %S: %S command.invalidOptTypeArg-3 = Invalid argument for %S option %S: %S
command.parsing-1 = Error parsing arguments: %S command.parsing-1 = Error parsing arguments: %S
command.none = No user-defined commands found
command.unknownCompleter-1 = E117: Unknown function: %S
command.exists = E174: Command already exists: add ! to replace it
command.noPrevious = E30: No previous command line
command.noRange = E481: No range allowed
command.noRange = E477: No ! allowed
command.colorscheme.notFound = E185: Cannot find color scheme %S command.colorscheme.notFound = E185: Cannot find color scheme %S
command.conditional.illegal = Invalid use of conditional command.conditional.illegal = Invalid use of conditional
command.finish.illegal = E168: :finish used outside of a sourced file command.finish.illegal = E168: :finish used outside of a sourced file
commmand.let.noSuch-1 = E108: No such variable: %S
command.let.unexpectedChar = E18: Unexpected characters in :let
command.let.illegalVar-1 = E461: Illegal variable name: %S
command.let.undefinedVar-1 = E121: Undefined variable: %S
command.let.invalidExpression-1 = E15: Invalid expression: %S
dactyl.parsingCommandLine-1 = Parsing command line options: %S dactyl.parsingCommandLine-1 = Parsing command line options: %S
dactyl.notCommand-2 = E492: Not a %S command: %S
dialog.notAvailable-1 = Dialog %S not available dialog.notAvailable-1 = Dialog %S not available
@@ -59,6 +77,10 @@ emenu.notFound-1 = Menu not found: %S
event.error-2 = Processing %S event: %S event.error-2 = Processing %S event: %S
event.nothingToPass = No events to pass event.nothingToPass = No events to pass
finder.notFound-1 = E486: Pattern not found: %S
finder.atTop = find hit TOP, continuing at BOTTOM
finder.atBottom = find hit BOTTOM, continuing at TOP
help.dontPanic = E478: Don't panic! help.dontPanic = E478: Don't panic!
help.noFile-1 = Sorry, help file %S not found help.noFile-1 = Sorry, help file %S not found
help.noTopic-1 = Sorry, no help for %S help.noTopic-1 = Sorry, no help for %S
@@ -72,8 +94,12 @@ history.noURL = URL not found in history
io.noSuchDir = E344: Can't find directory %S io.noSuchDir = E344: Can't find directory %S
io.noPrevDir = E186: No previous directory io.noPrevDir = E186: No previous directory
io.notReadable-1 = Can't open file %S io.notReadable-1 = Can't open file %S
io.notWriteable-1 = %S: Can't open file for writing io.notWriteable-1 = Can't open file %S for writing
io.exists = File exists (add ! to override) io.exists = File exists (add ! to override)
io.exists-1 = File %S exists (add ! to override)
io.noCommand-1 = Command not found: %S
io.commandFailed = E472: Command failed
io.oneFileAllowed = E172: Only one file name allowed
macro.canceled-1 = Canceled playback of macro '%S' macro.canceled-1 = Canceled playback of macro '%S'
macro.recorded-1 = Recorded macro '%S' macro.recorded-1 = Recorded macro '%S'
@@ -115,8 +141,12 @@ save.invalidDestination-1 = Invalid destination: %S
status.link-1 = Link: %S status.link-1 = Link: %S
style.none = No mapping found
time.total = Total time: %S time.total = Total time: %S
variable.none = No variables found
window.cantAttachSame = Can't reattach to the same window window.cantAttachSame = Can't reattach to the same window
window.noIndex-1 = Window %S does not exist window.noIndex-1 = Window %S does not exist
@@ -131,6 +161,7 @@ error.invalidSort-1 = Invalid sort order: %S
error.argRequired = Argument required error.argRequired = Argument required
error.trailing = Trailing characters error.trailing = Trailing characters
error.trailing-1 = Trailing characters: %S
error.invalid-1 = Invalid %S error.invalid-1 = Invalid %S
error.invalidArgument = Invalid argument error.invalidArgument = Invalid argument
error.invalidArgument-1 = Invalid argument: %S error.invalidArgument-1 = Invalid argument: %S

View File

@@ -53,7 +53,7 @@ var updateAddons = Class("UpgradeListener", AddonListener, {
this.remaining = addons; this.remaining = addons;
this.upgrade = []; this.upgrade = [];
this.dactyl.echomsg("Checking updates for addons: " + addons.map(function (a) a.name).join(", ")); this.dactyl.echomsg(_("addon.check", addons.map(function (a) a.name).join(", ")));
for (let addon in values(addons)) for (let addon in values(addons))
addon.findUpdates(this, AddonManager.UPDATE_WHEN_USER_REQUESTED, null, null); addon.findUpdates(this, AddonManager.UPDATE_WHEN_USER_REQUESTED, null, null);
@@ -391,9 +391,9 @@ var Addons = Module("addons", {
else if (file.isReadable() && file.isFile()) else if (file.isReadable() && file.isFile())
AddonManager.getInstallForFile(file, install, "application/x-xpinstall"); AddonManager.getInstallForFile(file, install, "application/x-xpinstall");
else if (file.isDirectory()) else if (file.isDirectory())
dactyl.echoerr("Cannot install a directory: " + file.path.quote()); dactyl.echoerr(_("addon.cantInstallDir", file.path.quote()));
else else
dactyl.echoerr("E484: Can't open file " + file.path); dactyl.echoerr(_("io.notReadable-1", file.path));
}, { }, {
argCount: "1", argCount: "1",
completer: function (context) { completer: function (context) {

View File

@@ -164,9 +164,9 @@ var Command = Class("Command", {
modifiers = modifiers || {}; modifiers = modifiers || {};
if (args.count != null && !this.count) if (args.count != null && !this.count)
throw FailedAssertion("E481: No range allowed"); throw FailedAssertion(_("command.noRange"));
if (args.bang && !this.bang) if (args.bang && !this.bang)
throw FailedAssertion("E477: No ! allowed"); throw FailedAssertion(_("command.noBang"));
return !dactyl.trapErrors(function exec() { return !dactyl.trapErrors(function exec() {
let extra = this.hive.argsExtra(args); let extra = this.hive.argsExtra(args);
@@ -635,7 +635,7 @@ var Commands = Module("commands", {
} }
if (!this.userHives.some(function (h) h._list.length)) if (!this.userHives.some(function (h) h._list.length))
dactyl.echomsg("No user-defined commands found"); dactyl.echomsg(_("command.none"));
else else
commandline.commandOutput( commandline.commandOutput(
<table> <table>
@@ -1396,7 +1396,7 @@ var Commands = Module("commands", {
} }
catch (e) { catch (e) {
dactyl.echo(":" + this.name + " ..."); dactyl.echo(":" + this.name + " ...");
dactyl.echoerr("E117: Unknown function: " + completer); dactyl.echoerr(_("command.unknownCompleter", completer));
dactyl.log(e); dactyl.log(e);
return undefined; return undefined;
} }
@@ -1433,7 +1433,7 @@ var Commands = Module("commands", {
}, args.bang); }, args.bang);
if (!added) if (!added)
dactyl.echoerr("E174: Command already exists: add ! to replace it"); dactyl.echoerr(_("command.exists"));
} }
}, { }, {
bang: true, bang: true,
@@ -1598,7 +1598,7 @@ var Commands = Module("commands", {
dactyl.execute(commands.repeat); dactyl.execute(commands.repeat);
} }
else else
dactyl.echoerr("E30: No previous command line"); dactyl.echoerr(_("command.noPrevious"));
}, },
{ count: true }); { count: true });
} }

View File

@@ -7,7 +7,7 @@
Components.utils.import("resource://dactyl/bootstrap.jsm"); Components.utils.import("resource://dactyl/bootstrap.jsm");
defineModule("finder", { defineModule("finder", {
exports: ["RangeFind", "RangeFinder", "rangefinder"], exports: ["RangeFind", "RangeFinder", "rangefinder"],
use: ["services", "util"] use: ["messages", "services", "util"]
}, this); }, this);
function equals(a, b) XPCNativeWrapper(a) == XPCNativeWrapper(b); function equals(a, b) XPCNativeWrapper(a) == XPCNativeWrapper(b);
@@ -93,7 +93,7 @@ var RangeFinder = Module("rangefinder", {
find: function (pattern, backwards) { find: function (pattern, backwards) {
let str = this.bootstrap(pattern, backwards); let str = this.bootstrap(pattern, backwards);
if (!this.rangeFind.find(str)) if (!this.rangeFind.find(str))
this.dactyl.echoerr("E486: Pattern not found: " + pattern, this.dactyl.echoerr(_("finder.notFound", pattern),
this.commandline.FORCE_SINGLELINE); this.commandline.FORCE_SINGLELINE);
return this.rangeFind.found; return this.rangeFind.found;
@@ -103,11 +103,11 @@ var RangeFinder = Module("rangefinder", {
if (!this.rangeFind) if (!this.rangeFind)
this.find(this.lastFindPattern); this.find(this.lastFindPattern);
else if (!this.rangeFind.find(null, reverse)) else if (!this.rangeFind.find(null, reverse))
this.dactyl.echoerr("E486: Pattern not found: " + this.lastFindPattern, this.dactyl.echoerr(_("finder.notFound", this.lastFindPattern),
this.commandline.FORCE_SINGLELINE); this.commandline.FORCE_SINGLELINE);
else if (this.rangeFind.wrapped) { else if (this.rangeFind.wrapped) {
let msg = this.rangeFind.backward ? "find hit TOP, continuing at BOTTOM" let msg = this.rangeFind.backward ? _("finder.atTop")
: "find hit BOTTOM, continuing at TOP"; : _("finder.atBottom");
this.commandline.echo(msg, "WarningMsg", this.commandline.APPEND_TO_MESSAGES this.commandline.echo(msg, "WarningMsg", this.commandline.APPEND_TO_MESSAGES
| this.commandline.FORCE_SINGLELINE); | this.commandline.FORCE_SINGLELINE);
} }

View File

@@ -158,7 +158,7 @@ var IO = Module("io", {
if (!file.exists() || !file.isReadable() || file.isDirectory()) { if (!file.exists() || !file.isReadable() || file.isDirectory()) {
if (!params.silent) if (!params.silent)
dactyl.echoerr("E484: Can't open file " + filename.quote()); dactyl.echoerr(_("io.notReadable", filename.quote()));
return; return;
} }
@@ -430,7 +430,7 @@ var IO = Module("io", {
let file = this.pathSearch(program); let file = this.pathSearch(program);
if (!file || !file.exists()) { if (!file || !file.exists()) {
util.dactyl.echoerr("Command not found: " + program); util.dactyl.echoerr(_("io.noCommand", program));
if (callable(blocking)) if (callable(blocking))
util.trapErrors(blocking); util.trapErrors(blocking);
return -1; return -1;
@@ -586,8 +586,8 @@ var IO = Module("io", {
} }
} }
dactyl.echoerr("E344: Can't find directory " + arg.quote() + " in cdpath"); dactyl.echoerr(_("io.noSuchDir", arg.quote()));
dactyl.echoerr("E472: Command failed"); dactyl.echoerr(_("io.commandFailed"));
} }
}, { }, {
argCount: "?", argCount: "?",
@@ -603,12 +603,11 @@ var IO = Module("io", {
commands.add([config.name.replace(/(.)(.*)/, "mk$1[$2rc]")], commands.add([config.name.replace(/(.)(.*)/, "mk$1[$2rc]")],
"Write current key mappings and changed options to the config file", "Write current key mappings and changed options to the config file",
function (args) { function (args) {
dactyl.assert(args.length <= 1, "E172: Only one file name allowed"); dactyl.assert(args.length <= 1, _("io.oneFileAllowed"));
let file = io.File(args[0] || io.getRCFile(null, true)); let file = io.File(args[0] || io.getRCFile(null, true));
dactyl.assert(!file.exists() || args.bang, dactyl.assert(!file.exists() || args.bang, _("io.exists", file.path.quote()));
"E189: " + file.path.quote() + " exists (add ! to override)");
// TODO: Use a set/specifiable list here: // TODO: Use a set/specifiable list here:
let lines = [cmd.serialize().map(commands.commandToString, cmd) for (cmd in commands.iterator(true)) if (cmd.serialize)]; let lines = [cmd.serialize().map(commands.commandToString, cmd) for (cmd in commands.iterator(true)) if (cmd.serialize)];
@@ -621,7 +620,7 @@ var IO = Module("io", {
file.write(lines.join("\n")); file.write(lines.join("\n"));
} }
catch (e) { catch (e) {
dactyl.echoerr("E190: Cannot open " + file.path.quote() + " for writing"); dactyl.echoerr(_("io.notWriteable"), file.path.quote());
dactyl.log("Could not write to " + file.path + ": " + e.message); // XXX dactyl.log("Could not write to " + file.path + ": " + e.message); // XXX
} }
}, { }, {
@@ -793,7 +792,7 @@ unlet s:cpo_save
"Read Ex commands from a file", "Read Ex commands from a file",
function (args) { function (args) {
if (args.length > 1) if (args.length > 1)
dactyl.echoerr("E172: Only one file name allowed"); dactyl.echoerr(_("io.oneFileAllowed"));
else else
io.source(args[0], { silent: args.bang }); io.source(args[0], { silent: args.bang });
}, { }, {

View File

@@ -237,8 +237,8 @@ var Option = Class("Option", {
*/ */
isValidValue: function isValidValue(values) this.validator(values), isValidValue: function isValidValue(values) this.validator(values),
invalidArgument: function invalidArgument(arg, op) "E474: Invalid argument: " + invalidArgument: function invalidArgument(arg, op) _("error.invalidArgument",
this.name + (op || "").replace(/=?$/, "=") + arg, this.name + (op || "").replace(/=?$/, "=") + arg),
/** /**
* Resets the option to its default value. * Resets the option to its default value.
@@ -1066,7 +1066,7 @@ var Options = Module("options", {
else { else {
flushList(); flushList();
if (opt.option.type === "boolean") { if (opt.option.type === "boolean") {
util.assert(!opt.valueGiven, "E474: Invalid argument: " + arg); util.assert(!opt.valueGiven, _("error.invalidArgument", arg));
opt.values = !opt.unsetBoolean; opt.values = !opt.unsetBoolean;
} }
else if (/^(string|number)$/.test(opt.option.type) && opt.invert) else if (/^(string|number)$/.test(opt.option.type) && opt.invert)
@@ -1192,7 +1192,7 @@ var Options = Module("options", {
} }
</table>; </table>;
if (str.text().length() == str.*.length()) if (str.text().length() == str.*.length())
dactyl.echomsg("No variables found"); dactyl.echomsg(_("variable.none"));
else else
dactyl.echo(str, commandline.FORCE_MULTILINE); dactyl.echo(str, commandline.FORCE_MULTILINE);
return; return;
@@ -1204,9 +1204,9 @@ var Options = Module("options", {
let fullName = (scope || "") + name; let fullName = (scope || "") + name;
util.assert(scope == "g:" || scope == null, util.assert(scope == "g:" || scope == null,
"E461: Illegal variable name: " + scope + name); _("command.let.illegalVar", scope + name));
util.assert(set.has(globalVariables, name) || (expr && !op), util.assert(set.has(globalVariables, name) || (expr && !op),
"E121: Undefined variable: " + fullName); _("command.let.undefinedVar", fullName));
if (!expr) if (!expr)
dactyl.echo(fullName + "\t\t" + fmt(globalVariables[name])); dactyl.echo(fullName + "\t\t" + fmt(globalVariables[name]));
@@ -1216,7 +1216,7 @@ var Options = Module("options", {
} }
catch (e) {} catch (e) {}
util.assert(newValue !== undefined, util.assert(newValue !== undefined,
"E15: Invalid expression: " + expr); _("command.let.invalidExpression", expr));
let value = newValue; let value = newValue;
if (op) { if (op) {
@@ -1232,7 +1232,7 @@ var Options = Module("options", {
} }
} }
else else
dactyl.echoerr("E18: Unexpected characters in :let"); dactyl.echoerr(_("command.let.unexpectedChar"));
}, },
{ {
deprecated: "the options system", deprecated: "the options system",
@@ -1305,7 +1305,7 @@ var Options = Module("options", {
name = name.replace(/^g:/, ""); // throw away the scope prefix name = name.replace(/^g:/, ""); // throw away the scope prefix
if (!set.has(dactyl._globalVariables, name)) { if (!set.has(dactyl._globalVariables, name)) {
if (!args.bang) if (!args.bang)
dactyl.echoerr("E108: No such variable: " + name); dactyl.echoerr(_("command.let.noSuch", name));
return; return;
} }

View File

@@ -12,7 +12,7 @@ Components.utils.import("resource://dactyl/bootstrap.jsm");
defineModule("prefs", { defineModule("prefs", {
exports: ["Prefs", "localPrefs", "prefs"], exports: ["Prefs", "localPrefs", "prefs"],
require: ["services", "util"], require: ["services", "util"],
use: ["config", "template"] use: ["config", "messages", "template"]
}, this); }, this);
var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), { var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), {
@@ -221,7 +221,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
util.assert(type === Ci.nsIPrefBranch.PREF_INVALID || type === needType, util.assert(type === Ci.nsIPrefBranch.PREF_INVALID || type === needType,
type === Ci.nsIPrefBranch.PREF_INT type === Ci.nsIPrefBranch.PREF_INT
? "E521: Number required after =: " + name + "=" + value ? "E521: Number required after =: " + name + "=" + value
: "E474: Invalid argument: " + name + "=" + value); : _("error.invalidArgument", name + "=" + value));
let type = this.branch.getPrefType(name); let type = this.branch.getPrefType(name);
switch (typeof value) { switch (typeof value) {
@@ -289,7 +289,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
*/ */
toggle: function (name) { toggle: function (name) {
util.assert(this.branch.getPrefType(name) === Ci.nsIPrefBranch.PREF_BOOL, util.assert(this.branch.getPrefType(name) === Ci.nsIPrefBranch.PREF_BOOL,
"E488: Trailing characters: " + name + "!"); _("error.trailing", name + "!"));
this.set(name, !this.get(name)); this.set(name, !this.get(name));
}, },

View File

@@ -17,7 +17,8 @@ try {
Components.utils.import("resource://dactyl/bootstrap.jsm"); Components.utils.import("resource://dactyl/bootstrap.jsm");
defineModule("sanitizer", { defineModule("sanitizer", {
exports: ["Range", "Sanitizer", "sanitizer"], exports: ["Range", "Sanitizer", "sanitizer"],
require: ["prefs", "services", "storage", "template", "util"] require: ["prefs", "services", "storage", "template", "util"],
use: ["messages"]
}, this); }, this);
let tmp = {}; let tmp = {};
@@ -389,7 +390,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
}, window); }, window);
}, },
commands: function (dactyl, modules, window) { commands: function (dactyl, modules, window) {
const commands = modules.commands; const { commands } = modules;
commands.add(["sa[nitize]"], commands.add(["sa[nitize]"],
"Clear private data", "Clear private data",
function (args) { function (args) {
@@ -408,7 +409,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
args[0] = "all"; args[0] = "all";
if (args.bang) { if (args.bang) {
dactyl.assert(args.length == 0, "E488: Trailing characters"); dactyl.assert(args.length == 0, _("error.trailing"));
items = Object.keys(sanitizer.itemMap).filter( items = Object.keys(sanitizer.itemMap).filter(
function (k) modules.options.get("sanitizeitems").has(k)); function (k) modules.options.get("sanitizeitems").has(k));
} }
@@ -509,7 +510,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
for (c in Sanitizer.iterCookies(host))))); for (c in Sanitizer.iterCookies(host)))));
return; return;
default: default:
util.assert(cmd in Sanitizer.PERMS, "Invalid argument"); util.assert(cmd in Sanitizer.PERMS, _("error.invalidArgument"));
setPerms(host, cmd); setPerms(host, cmd);
} }
}, { }, {

View File

@@ -337,7 +337,7 @@ var Styles = Module("Styles", {
// TODO: Move this to an ItemList to show this automatically // TODO: Move this to an ItemList to show this automatically
if (list.*.length() === list.text().length() + 2) if (list.*.length() === list.text().length() + 2)
dactyl.echomsg("No mapping found"); dactyl.echomsg(_("style.none"));
else else
commandline.commandOutput(list); commandline.commandOutput(list);
}, },

View File

@@ -237,7 +237,7 @@ const Config = Module("config", ConfigBase, {
"Close a display pane", "Close a display pane",
function (args) { function (args) {
let arg = args.literalArg; let arg = args.literalArg;
dactyl.assert(arg in Config.displayPanes, "E475: Invalid argument: " + arg); dactyl.assert(arg in Config.displayPanes, _("error.invalidArgument", arg));
config.closeDisplayPane(Config.displayPanes[arg]); config.closeDisplayPane(Config.displayPanes[arg]);
}, },
{ {
@@ -251,7 +251,7 @@ const Config = Module("config", ConfigBase, {
"Open a display pane", "Open a display pane",
function (args) { function (args) {
let arg = args.literalArg; let arg = args.literalArg;
dactyl.assert(arg in Config.displayPanes, "E475: Invalid argument: " + arg); dactyl.assert(arg in Config.displayPanes, _("error.invalidArgument", arg));
// TODO: focus when we have better key handling of these extended modes // TODO: focus when we have better key handling of these extended modes
config.openDisplayPane(Config.displayPanes[arg]); config.openDisplayPane(Config.displayPanes[arg]);
}, },

View File

@@ -264,7 +264,7 @@ const Player = Module("player", {
this.focusTrack(searchView.getItemByIndex(this._lastSearchIndex)); this.focusTrack(searchView.getItemByIndex(this._lastSearchIndex));
} }
else else
dactyl.echoerr("E486 Pattern not found: " + searchString, commandline.FORCE_SINGLELINE); dactyl.echoerr(_("finder.notFound", searchString), commandline.FORCE_SINGLELINE);
}, },
/** /**
@@ -283,7 +283,7 @@ const Player = Module("player", {
if (reverse) { if (reverse) {
if (this._lastSearchIndex == 0) { if (this._lastSearchIndex == 0) {
this._lastSearchIndex = this._lastSearchView.length - 1; this._lastSearchIndex = this._lastSearchView.length - 1;
echo("Search hit TOP, continuing at BOTTOM"); echo(_("finder.atTop"));
} }
else else
this._lastSearchIndex = this._lastSearchIndex - 1; this._lastSearchIndex = this._lastSearchIndex - 1;
@@ -291,7 +291,7 @@ const Player = Module("player", {
else { else {
if (this._lastSearchIndex == (this._lastSearchView.length - 1)) { if (this._lastSearchIndex == (this._lastSearchView.length - 1)) {
this._lastSearchIndex = 0; this._lastSearchIndex = 0;
echo("Search hit BOTTOM, continuing at TOP"); echo(_("finder.atBottom"));
} }
else else
this._lastSearchIndex = this._lastSearchIndex + 1; this._lastSearchIndex = this._lastSearchIndex + 1;
@@ -504,7 +504,7 @@ const Player = Module("player", {
return; return;
} }
} }
dactyl.echoerr("E475: Invalid argument: " + arg); dactyl.echoerr(_("error.invalidArgument", arg));
} }
else { else {
// load main library if there are no args // load main library if there are no args
@@ -547,7 +547,7 @@ const Player = Module("player", {
// intentionally supports 999:99:99 // intentionally supports 999:99:99
dactyl.assert(/^[+-]?(\d+[smh]?|(\d+:\d\d:|\d+:)?\d{2})$/.test(arg), dactyl.assert(/^[+-]?(\d+[smh]?|(\d+:\d\d:|\d+:)?\d{2})$/.test(arg),
"E475: Invalid argument: " + arg); _("error.invalidArgument", arg));
function ms(t, m) Math.abs(parseInt(t, 10) * { s: 1000, m: 60000, h: 3600000 }[m]) function ms(t, m) Math.abs(parseInt(t, 10) * { s: 1000, m: 60000, h: 3600000 }[m])
@@ -588,7 +588,7 @@ const Player = Module("player", {
return; return;
} }
} }
dactyl.echoerr("E475: Invalid argument: " + arg); dactyl.echoerr(_("error.invalidArgument", arg));
} }
}, },
{ {
@@ -659,8 +659,8 @@ const Player = Module("player", {
function (args) { function (args) {
let arg = args[0]; let arg = args[0];
dactyl.assert(arg, "E471: Argument required"); dactyl.assert(arg, _("error.argumentRequired"));
dactyl.assert(/^[+-]?\d+$/.test(arg), "E488: Trailing characters"); dactyl.assert(/^[+-]?\d+$/.test(arg), _("error.trailing"));
let level = parseInt(arg, 10) / 100; let level = parseInt(arg, 10) / 100;

View File

@@ -695,7 +695,7 @@ const Mail = Module("mail", {
let newPos = mail._getCurrentFolderIndex() + Math.max(1, args.count); let newPos = mail._getCurrentFolderIndex() + Math.max(1, args.count);
if (newPos >= gFolderTreeView.rowCount) { if (newPos >= gFolderTreeView.rowCount) {
newPos = newPos % gFolderTreeView.rowCount; newPos = newPos % gFolderTreeView.rowCount;
commandline.echo("search hit BOTTOM, continuing at TOP", commandline.HL_WARNINGMSG, commandline.APPEND_TO_MESSAGES); commandline.echo(_("finder.atBottom"), commandline.HL_WARNINGMSG, commandline.APPEND_TO_MESSAGES);
} }
gFolderTreeView.selection.timedSelect(newPos, 500); gFolderTreeView.selection.timedSelect(newPos, 500);
}, },
@@ -714,7 +714,7 @@ const Mail = Module("mail", {
let newPos = mail._getCurrentFolderIndex() - Math.max(1, args.count); let newPos = mail._getCurrentFolderIndex() - Math.max(1, args.count);
if (newPos < 0) { if (newPos < 0) {
newPos = (newPos % gFolderTreeView.rowCount) + gFolderTreeView.rowCount; newPos = (newPos % gFolderTreeView.rowCount) + gFolderTreeView.rowCount;
commandline.echo("search hit TOP, continuing at BOTTOM", commandline.HL_WARNINGMSG, commandline.APPEND_TO_MESSAGES); commandline.echo(_("finder.atTop"), commandline.HL_WARNINGMSG, commandline.APPEND_TO_MESSAGES);
} }
gFolderTreeView.selection.timedSelect(newPos, 500); gFolderTreeView.selection.timedSelect(newPos, 500);
}, },