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

Localization-related changes. Fix dead help links.

This commit is contained in:
Kris Maglione
2011-03-04 23:04:06 -05:00
parent 058094f87d
commit 96c5044ac4
20 changed files with 150 additions and 130 deletions

View File

@@ -1084,7 +1084,7 @@ var Commands = Module("commands", {
complete.advance(args.completeStart);
complete.keys = {
text: "names",
description: function (opt) messages.get(["command", params.name, opt.names[0], "description"].join("."), opt.description)
description: function (opt) messages.get(["command", params.name, "options", opt.names[0], "description"].join("."), opt.description)
};
complete.title = ["Options"];
if (completeOpts)

View File

@@ -84,6 +84,8 @@ var CompletionContext = Class("CompletionContext", {
*/
self.waitingForTab = false;
self.hasItems = null;
delete self._generate;
delete self.ignoreCase;
if (self != this)
@@ -329,7 +331,7 @@ var CompletionContext = Class("CompletionContext", {
* The message displayed at the head of the completions for the
* current context.
*/
get message() this._message || (this.waitingForTab ? "Waiting for <Tab>" : null),
get message() this._message || (this.waitingForTab && this.hasItems !== false ? "Waiting for <Tab>" : null),
set message(val) this._message = val,
/**
@@ -1014,16 +1016,16 @@ var Completion = Module("completion", {
options: function (dactyl, modules, window) {
const { completion, options } = modules;
let wildmode = {
values: [
values: {
// Why do we need ""?
// Because its description is useful during completion. --Kris
["", "Complete only the first match"],
["full", "Complete the next full match"],
["longest", "Complete the longest common string"],
["list", "If more than one match, list all matches"],
["list:full", "List all and complete first match"],
["list:longest", "List all and complete the longest common string"]
],
"": "Complete only the first match",
"full": "Complete the next full match",
"longest": "Complete the longest common string",
"list": "If more than one match, list all matches",
"list:full": "List all and complete first match",
"list:longest": "List all and complete the longest common string"
},
checkHas: function (value, val) {
let [first, second] = value.split(":", 2);
return first == val || second == val;
@@ -1056,11 +1058,11 @@ var Completion = Module("completion", {
"Completion case matching mode",
"regexpmap", ".?:smart",
{
values: [
["smart", "Case is significant when capital letters are typed"],
["match", "Case is always significant"],
["ignore", "Case is never significant"]
]
values: {
"smart": "Case is significant when capital letters are typed",
"match": "Case is always significant",
"ignore": "Case is never significant"
}
});
options.add(["wildmode", "wim"],

View File

@@ -288,7 +288,7 @@ var Contexts = Module("contexts", {
initializedGroups: function (hive)
let (need = hive ? [hive] : Object.keys(this.hives))
this.groupList.filter(function (group) need.some(function (name) set.has(group, name))),
this.groupList.filter(function (group) need.some(set.has(group))),
addGroup: function addGroup(name, description, filter, persist, replace) {
let group = this.getGroup(name);
@@ -482,7 +482,7 @@ var Contexts = Module("contexts", {
util.assert(!group.builtin ||
!["-description", "-locations", "-nopersist"]
.some(function (arg) set.has(args.explicitOpts, arg)),
.some(set.has(args.explicitOpts)),
_("group.cantModifyBuiltin"));
},
{

View File

@@ -264,11 +264,11 @@ var RangeFinder = Module("rangefinder", {
"Find case matching mode",
"string", "smart",
{
values: [
["smart", "Case is significant when capital letters are typed"],
["match", "Case is always significant"],
["ignore", "Case is never significant"]
]
values: {
"smart": "Case is significant when capital letters are typed",
"match": "Case is always significant",
"ignore": "Case is never significant"
}
});
options.add(["incfind", "if"],

View File

@@ -691,11 +691,13 @@ var Option = Class("Option", {
if (!acceptable)
acceptable = context.allItems.items.map(function (item) [item.text]);
}
if (this.type === "regexpmap" || this.type === "sitemap")
return Array.concat(values).every(function (re) acceptable.some(function (item) item[0] == re.result));
if (isArray(acceptable))
acceptable = set(acceptable.map(function ([k]) k));
if (this.type === "regexpmap" || this.type === "sitemap")
return Array.concat(values).every(function (re) set.has(acceptable, re.result));
return Array.concat(values).every(set.has(acceptable));
}
});

View File

@@ -566,7 +566,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
"The default list of private items to sanitize",
"stringlist", "all",
{
get values() values(sanitizer.itemMap),
get values() values(sanitizer.itemMap).toArray(),
has: modules.Option.has.toggleAll,
validator: function (values) values.length &&
values.every(function (val) val === "all" || set.has(sanitizer.itemMap, val))
@@ -604,14 +604,14 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
context.compare = context.constructor.Sort.Unsorted;
context.completions = this.values;
},
values: [
["all", "Everything"],
["session", "The current session"],
["10m", "Last ten minutes"],
["1h", "Past hour"],
["1d", "Past day"],
["1w", "Past week"]
],
values: {
"all": "Everything",
"session": "The current session",
"10m": "Last ten minutes",
"1h": "Past hour",
"1d": "Past day",
"1w": "Past week"
},
validator: function (value) /^(a(ll)?|s(ession)|\d+[mhdw])$/.test(value)
});