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

Move some more message strings to the properties file.

This commit is contained in:
Doug Kearns
2011-03-10 22:06:29 +11:00
parent 0196d116a1
commit 11623d4f8b
10 changed files with 35 additions and 18 deletions

View File

@@ -119,7 +119,7 @@ var Map = Class("Map", {
mappings.repeat = repeat;
if (this.executing)
util.dumpStack("Attempt to execute mapping recursively: " + args.command);
util.dumpStack(_("map.recursive", args.command));
dactyl.assert(!this.executing, _("map.recursive", args.command));
try {

View File

@@ -428,7 +428,7 @@ var Modes = Module("modes", {
init: function init(name, options, params) {
if (options.bases)
util.assert(options.bases.every(function (m) m instanceof this, this.constructor),
"Invalid bases", true);
_("mode.invalidBases"), true);
update(this, {
id: 1 << Modes.Mode._id++,

View File

@@ -7,6 +7,8 @@ abbrev.none = No abbreviations found
addon.check-1 = Checking updates for addons: %S
addon.cantInstallDir-1 = Cannot install a directory: %S
addon.unavailable = Don't have add-on yet
addon.uknownCommand = Unknown command
addon.commandNotAllowed = Command not allowed
autocmd.executing-2 = Executing %S Auto commands for %S
autocmd.autocommand-1 = autocommand %S
@@ -62,6 +64,13 @@ 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
command.run.noPrevious = E34: No previous command
command.sanitize.privateMode = Cannot sanitize items in private mode
command.set.numberRequired-2 = E521: Number required after =: %S=%S
command.set.errorParsing-1 = Error parsing :set command: %S
command.set.unknownOption-1 = E518: Unknown option: %S
# TODO: use generic builtin message?
command.style.cantChangeBuiltin = Cannot modify styles in the builtin group
dactyl.parsingCommandLine-1 = Parsing command line options: %S
dactyl.notCommand-2 = E492: Not a %S command: %S
@@ -74,6 +83,10 @@ dactyl.initialized-1 = %S fully initialized
dialog.notAvailable-1 = Dialog %S not available
# TODO: merge with addon.*?
download.uknownCommand = Unknown command
download.commandNotAllowed = Command not allowed
group.cantChangeBuiltin-1 = Cannot change %S in the builtin group
group.cantModifyBuiltin = Cannot modify builtin group
group.cantRemoveBuiltin = Cannot remove builtin group
@@ -138,6 +151,7 @@ mark.unset-1 = Mark not set: %S
mark.noMatching-1 = E283: No marks matching %S
mode.recursiveSet = Not executing modes.set recursively
mode.invalidBases = Invalid bases
mow.noPreviousOutput = No previous command output
@@ -192,6 +206,9 @@ error.argumentOrBang = Argument or ! required
error.invalidOperation = Invalid operation
error.monkeyPatchOverlay-1 = Not replacing property with eval-generated overlay by %S
error.nullComputedStyle-1 = Computed style is null: %S
error.syntaxError = Syntax error
error.charsOutsideRange-1 = Character list outside the range %S
error.invalidCharRange = Invalid character range: %S
warn.notDefaultBranch-2 = You are running %S from a testing branch: %S. Please do not report errors which do not also occur in the default branch.

View File

@@ -165,7 +165,7 @@ var Addon = Class("Addon", {
},
commandAllowed: function commandAllowed(cmd) {
util.assert(set.has(actions, cmd), "Unknown command");
util.assert(set.has(actions, cmd), _("addon.unknownCommand"));
let action = actions[cmd];
if ("perm" in action && !(this.permissions & AddonManager["PERM_CAN_" + action.perm.toUpperCase()]))
@@ -176,7 +176,7 @@ var Addon = Class("Addon", {
},
command: function command(cmd) {
util.assert(this.commandAllowed(cmd), "Command not allowed");
util.assert(this.commandAllowed(cmd), _("addon.commandNotAllowed"));
let action = actions[cmd];
if (action.action)

View File

@@ -78,8 +78,8 @@ var Download = Class("Download", {
})),
command: function command(name) {
util.assert(set.has(this.allowedCommands, name), "Unknown command");
util.assert(this.allowedCommands[name], "Command not allowed");
util.assert(set.has(this.allowedCommands, name), _("download.unknownCommand"));
util.assert(this.allowedCommands[name], _("download.commandNotAllowed"));
services.downloadManager[name + "Download"](this.id);
},

View File

@@ -639,7 +639,7 @@ var IO = Module("io", {
if (file.exists() && file.isDirectory() || args[0] && /\/$/.test(args[0]))
file.append(config.name + ".vim");
dactyl.assert(!file.exists() || args.bang, "File exists");
dactyl.assert(!file.exists() || args.bang, _("io.exists"));
let template = util.compileMacro(<![CDATA[
" Vim syntax file
@@ -819,7 +819,7 @@ unlet s:cpo_save
if (modules.options["banghist"]) {
// replaceable bang and no previous command?
dactyl.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || io._lastRunCommand,
"E34: No previous command");
_("command.run.noPrevious"));
arg = arg.replace(/(\\)*!/g,
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand)

View File

@@ -536,7 +536,7 @@ var Option = Class("Option", {
if (v.length > count)
return prev = parse.call(this, filter, val);
else {
util.assert(prev, "Syntax error", false);
util.assert(prev, _("error.syntaxError"), false);
prev.result += "," + v;
}
}, this))
@@ -592,7 +592,7 @@ var Option = Class("Option", {
let value = parseInt(values);
util.assert(Number(values) % 1 == 0,
"E521: Number required after =: " + this.name + "=" + values);
_("command.set.numberRequired", this.name, values));
switch (operator) {
case "+":
@@ -1044,10 +1044,10 @@ var Options = Module("options", {
}
let opt = modules.options.parseOpt(arg, modifiers);
util.assert(opt, "Error parsing :set command: " + arg);
util.assert(opt, _("command.set.errorParsing", arg));
let option = opt.option;
util.assert(option != null || opt.all, "E518: Unknown option: " + opt.name);
util.assert(option != null || opt.all, _("command.set.unknownOption", opt.name));
// reset a variable to its default value
if (opt.reset) {

View File

@@ -399,7 +399,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
commands.add(["sa[nitize]"],
"Clear private data",
function (args) {
dactyl.assert(!modules.options['private'], "Cannot sanitize items in private mode");
dactyl.assert(!modules.options['private'], _("command.sanitize.privateMode"));
let timespan = args["-timespan"] || modules.options["sanitizetimespan"];
@@ -419,7 +419,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
function (k) modules.options.get("sanitizeitems").has(k));
}
else
dactyl.assert(modules.options.get("sanitizeitems").validator(items), "Valid items required");
dactyl.assert(modules.options.get("sanitizeitems").validator(items), _("error.invalidArgument"));
if (items.indexOf("all") >= 0)
items = Object.keys(sanitizer.itemMap).filter(function (k) items.indexOf(k) === -1);

View File

@@ -556,7 +556,7 @@ var Styles = Module("Styles", {
styles.list(window.content, filter, args["-name"], args.explicitOpts["-group"] ? [args["-group"]] : null);
else {
util.assert(args["-group"].modifiable && args["-group"].hive.modifiable,
"Cannot modify styles in the builtin group");
_("command.style.cantChangeBuiltin"));
if (args["-append"]) {
let sheet = args["-group"].get(args["-name"]);
@@ -642,7 +642,7 @@ var Styles = Module("Styles", {
commands.add(cmd.name, cmd.desc,
function (args) {
dactyl.assert(args.bang ^ !!(args[0] || args[1] || args["-name"] || args["-index"]),
"Argument or ! required");
_("error.argumentOrBang"));
args["-group"].find(args["-name"], args[0], args.literalArg, args["-index"])
.forEach(cmd.action);

View File

@@ -181,12 +181,12 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
// check for chars not in the accepted range
this.assert(RegExp("^[" + accepted + "-]+$").test(list),
"Character list outside the range " + accepted.quote());
_("error.charsOutsideRange", accepted.quote()));
// check for illegal ranges
for (let [match] in this.regexp.iterate(/.-./g, list))
this.assert(match.charCodeAt(0) <= match.charCodeAt(2),
"Invalid character range: " + list.slice(list.indexOf(match)))
_("error.invalidCharRange", list.slice(list.indexOf(match))));
return RegExp("[" + util.regexp.escape(list) + "]");
},