1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 03:47:58 +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

@@ -1840,11 +1840,11 @@ var Buffer = Module("buffer", {
"Where to show the destination of the link under the cursor",
"string", "status",
{
values: [
["", "Don't show link destinations"],
["status", "Show link destinations in the status line"],
["command", "Show link destinations in the command line"]
]
values: {
"": "Don't show link destinations",
"status": "Show link destinations in the status line",
"command": "Show link destinations in the command line"
}
});
options.add(["usermode", "um"],

View File

@@ -1241,9 +1241,10 @@ var Hints = Module("hints", {
"The keys used to label and select hints",
"string", "0123456789",
{
values: [
["0123456789", "Numbers"],
["asdfg;lkjh", "Home Row"]],
values: {
"0123456789": "Numbers",
"asdfg;lkjh": "Home Row"
},
validator: function (value) {
let values = events.fromString(value).map(events.closure.toString);
return Option.validIf(array.uniq(values).length === values.length,
@@ -1262,24 +1263,24 @@ var Hints = Module("hints", {
"Change the behavior of <Return> in hint mode",
"number", 0,
{
values: [
["0", "Follow the first hint as soon as typed text uniquely identifies it. Follow the selected hint on <Return>."],
["1", "Follow the selected hint on <Return>."],
["2", "Follow the selected hint on <Return> only it's been <Tab>-selected."]
]
values: {
"0": "Follow the first hint as soon as typed text uniquely identifies it. Follow the selected hint on <Return>.",
"1": "Follow the selected hint on <Return>.",
"2": "Follow the selected hint on <Return> only it's been <Tab>-selected."
}
});
options.add(["hintmatching", "hm"],
"How hints are filtered",
"stringlist", "contains",
{
values: [
["contains", "The typed characters are split on whitespace. The resulting groups must all appear in the hint."],
["custom", "Delegate to a custom function: dactyl.plugins.customHintMatcher(hintString)"],
["firstletters", "Behaves like wordstartswith, but all groups must match a sequence of words."],
["wordstartswith", "The typed characters are split on whitespace. The resulting groups must all match the beginnings of words, in order."],
["transliterated", UTF8("When true, special latin characters are translated to their ASCII equivalents (e.g., é ⇒ e)")]
],
values: {
"contains": "The typed characters are split on whitespace. The resulting groups must all appear in the hint.",
"custom": "Delegate to a custom function: dactyl.plugins.customHintMatcher(hintString)",
"firstletters": "Behaves like wordstartswith, but all groups must match a sequence of words.",
"wordstartswith": "The typed characters are split on whitespace. The resulting groups must all match the beginnings of words, in order.",
"transliterated": UTF8("When true, special latin characters are translated to their ASCII equivalents (e.g., é ⇒ e)")
},
validator: function (values) Option.validateCompleter.call(this, values) &&
1 === values.reduce(function (acc, v) acc + (["contains", "custom", "firstletters", "wordstartswith"].indexOf(v) >= 0), 0)
});
@@ -1293,11 +1294,11 @@ var Hints = Module("hints", {
"Which text is used to filter hints for input elements",
"stringlist", "label,value",
{
values: [
["value", "Match against the value of the input field"],
["label", "Match against the text of a label for the input field, if one can be found"],
["name", "Match against the name of the input field"]
]
values: {
"value": "Match against the value of the input field",
"label": "Match against the text of a label for the input field, if one can be found",
"name": "Match against the name of the input field"
}
});
}
});

View File

@@ -987,11 +987,11 @@ var Tabs = Module("tabs", {
config.tabbrowser.tabContainer._positionPinnedTabs();
return value;
},
values: [
["never", "Never show the tab bar"],
["multitab", "Show the tab bar when there are multiple tabs"],
["always", "Always show the tab bar"]
]
values: {
"never": "Never show the tab bar",
"multitab": "Show the tab bar when there are multiple tabs",
"always": "Always show the tab bar"
}
});
if (config.hasTabbrowser) {
@@ -1030,15 +1030,15 @@ var Tabs = Module("tabs", {
"Define which commands should output in a new tab by default",
"stringlist", "",
{
values: [
["all", "All commands"],
["addons", ":addo[ns] command"],
["downloads", ":downl[oads] command"],
["extoptions", ":exto[ptions] command"],
["help", ":h[elp] command"],
["javascript", ":javascript! or :js! command"],
["prefs", ":pref[erences]! or :prefs! command"]
],
values: {
"all": "All commands",
"addons": ":addo[ns] command",
"downloads": ":downl[oads] command",
"extoptions": ":exto[ptions] command",
"help": ":h[elp] command",
"javascript": ":javascript! or :js! command",
"prefs": ":pref[erences]! or :prefs! command"
},
has: Option.has.toggleAll
});
@@ -1064,11 +1064,11 @@ var Tabs = Module("tabs", {
"See 'popups' option.");
return values;
},
values: [
["tab", "Open popups in a new tab"],
["window", "Open popups in a new window"],
["resized", "Open resized popups in a new window"]
]
values: {
"tab": "Open popups in a new tab",
"window": "Open popups in a new window",
"resized": "Open resized popups in a new window"
}
});
}
}

View File

@@ -102,8 +102,8 @@
</dd>
<dt>&tab;@mode</dt> <dd>The mode attribute to &lt;k>. Some keys have different functions in different modes.
You can use this attribute to specify which of the modes (other than Normal) a key pertains to.
The &lt;<a>value</a>> is prepended to the element's contents, i.e., <em>&lt;k name="C-i" mode="i"/></em>
becomes <em><k name="C-i" mode="i"/></em>, and <em>&lt;k mode="i">i&lt;/k></em> becomes <em><k mode="i">i</k></em>.
The &lt;<a>value</a>> is prepended to the element's contents, i.e., <em>&lt;k name="C-i" mode="I"/></em>
becomes <em><k name="C-i" mode="I"/></em>, and <em>&lt;k mode="t">i&lt;/k></em> becomes <em><k mode="t">i</k></em>.
</dd>
<dt>t</dt> <dd>Links to an arbitrary help topic. (HelpTopic)</dd>
</dl>

View File

@@ -31,7 +31,7 @@
<p>
Text Edit mode provides basic Vim-like text editing. It can be entered
from Insert mode by pressing <k name="C-t" mode="i"/> or started directly
from Insert mode by pressing <k name="C-t" mode="I"/> or started directly
when a text area is focused if <o>insertmode</o> is unset. See the
<link topic="t-map-index">index</link> for a list of currently supported
mappings.

View File

@@ -65,7 +65,7 @@
<description>
<p>
Start <t>QuickHint</t> mode, but the selected elements
are clicked with the <k name="Shift"/> key pressed,
are clicked with the <k name="Shift" link="false"/> key pressed,
which has the normal effect of opening it in a new tab
(depending on the value of the
<pref>browser.tabs.loadInBackground</pref> preference).

View File

@@ -37,11 +37,11 @@
For instance,
</p>
<code><ex>:map <k name="F2"/></ex> <ex>:echo Date()<k name="CR"/></ex></code>
<code><ex>:map <k name="F2" link="false"/></ex> <ex>:echo Date()<k name="CR"/></ex></code>
<p>
causes “<ex>:echo Date()<k name="CR"/></ex>” to be typed out
whenever <k name="F2"/> is pressed, thus echoing the full date
whenever <k name="F2" link="false"/> is pressed, thus echoing the full date
to the command line.
</p>
@@ -221,15 +221,6 @@
<h3 tag=":map-arguments">Special arguments</h3>
<tags>:map-&lt;silent></tags>
<p>
When the first argument to one of the mapping commands is
<k name="silent"/>, the keys in <a>rhs</a> are not shown in the
command line as they are generated. Nor, for that matter, is
anything else until the command has completed.
</p>
<p>
Below is an overview of which modes each map command applies to:
</p>
@@ -262,7 +253,7 @@
quotation marks or back-slashes. A space may additionally be
typed as <k name="Space"/>.
</li>
<li>
<li key="&lt;lt>">
As special key names start with the <em>&lt;</em> character,
a literal &lt; must be typed as <k name="lt"/>.
</li>
@@ -271,8 +262,8 @@
and <k name="Down"/> represent the standard arrow keys.
</li>
<li>
<k name="CapsLock"/>, <k name="NumLock"/>, <k name="Ins"/>
<k name="Del"/>, <k name="Tab"/>, <k name="PageUp"/>,
<k name="CapsLock" link="false"/>, <k name="NumLock" link="false"/>, <k name="Insert"/>
<k name="Del" link="false"/>, <k name="Tab"/>, <k name="PageUp"/>,
<k name="PageDown"/>, and <k name="Esc"/> work as
expected.
</li>
@@ -280,16 +271,16 @@
<k name="Return" link="false"/> or <k name="CR"/> represent the carriage
return key.
</li>
<li><k name="BS"/> represents the backspace key.</li>
<li><k name="F1"/> through <k name="F12"/> work as expected.</li>
<li><k name="BS" link="false"/> represents the backspace key.</li>
<li><k name="F1"/> through <k name="F12" link="false"/> work as expected.</li>
<li>
<k name="K0"/> through <k name="K9"/> represent keys on the
<k name="K0" link="false"/> through <k name="K9" link="false"/> represent keys on the
numeric keypad.
</li>
<li>
<k name="Uxxxx"/>, where <em>xxxx</em> is any 4 hexadecimal
<k name="Uxxxx" link="false"/>, where <em>xxxx</em> is any 4 hexadecimal
digits, represents the character at that Unicode codepoint.
For instance, <k name="U263a"/> represents ☺.
For instance, <k name="U263a" link="false"/> represents ☺.
</li>
</ul>
@@ -299,10 +290,10 @@
</p>
<ol>
<li><k name="C-␣"/>: The control or ctrl key.</li>
<li><k name="A-␣"/>: The alt key.</li>
<li><k name="M-␣"/>: The meta key, windows key, or command key.</li>
<li><k name="S-␣"/>: The shift key.</li>
<li><k name="C-␣" link="false"/>: The control or ctrl key.</li>
<li><k name="A-␣" link="false"/>: The alt key.</li>
<li><k name="M-␣" link="false"/>: The meta key, windows key, or command key.</li>
<li><k name="S-␣" link="false"/>: The shift key.</li>
</ol>
<p>
@@ -319,31 +310,31 @@
</p>
<dl dt="width: 10em;">
<dt><k>xc</k></dt>
<dt><k link="false">xc</k></dt>
<dd>Type the X key followed by the C key.</dd>
<dt><k name="C-x">c</k></dt>
<dt><k name="C-x" link="false">c</k></dt>
<dd>
Type the X key while holding the Control key, followed
by the C key.
</dd>
<dt><k name="C-2"/></dt>
<dt><k name="C-2" link="false"/></dt>
<dd>Type the 2 while holding the Control key.</dd>
<dt><k name="C-@"/></dt>
<dt><k name="C-@" link="false"/></dt>
<dd>Type the @ key while holding the Control key.</dd>
<dt><k name="S-Space"/></dt>
<dt><k name="S-Space" link="false"/></dt>
<dd>Press the space bar while holding the Shift key.</dd>
<dt><k name="C-A-j"/></dt>
<dt><k name="C-A-j" link="false"/></dt>
<dd>Type the J key while while holding both the Control and Alt keys.</dd>
<dt><k name="C-A-J"/></dt>
<dt><k name="C-A-J" link="false"/></dt>
<dd>Exactly the same as above.</dd>
<dt><k name="C-A-S-j"/></dt>
<dt><k name="C-A-S-j" link="false"/></dt>
<dd>Type the J key while while holding both the Control, Alt, and Shift keys.</dd>
</dl>

View File

@@ -66,20 +66,43 @@
</p>
<dl>
<dt><k name="CR"/> or j or <k name="Down"/></dt> <dd>one more line</dd>
<dt>d</dt> <dd>down a page (half a screen)</dd>
<dt><k name="Space"/> or <k name="PageDown"/></dt><dd>down a screen</dd>
<dt>G</dt> <dd>down all the way, until the hit-enter prompt</dd>
<dt><k name="CR" link="false"/> or j or <k name="Down" link="false"/></dt>
<dd>one more line</dd>
<dt>d</dt>
<dd>down a page (half a screen)</dd>
<dt><k name="Space" link="false"/> or <k name="PageDown" link="false"/></dt>
<dd>down a screen</dd>
<dt>G</dt>
<dd>down all the way, until the hit-enter prompt</dd>
<dt/><dd/>
<dt><k name="BS"/> or k or <k name="Up"/></dt> <dd>one line back</dd>
<dt>u</dt> <dd>up a page (half a screen)</dd>
<dt>b or <k name="PageUp"/></dt> <dd>back a screen</dd>
<dt>g</dt> <dd>back to the start</dd>
<dt><k name="BS" link="false"/> or k or <k name="Up" link="false"/></dt>
<dd>one line back</dd>
<dt>u</dt>
<dd>up a page (half a screen)</dd>
<dt>b or <k name="PageUp" link="false"/></dt>
<dd>back a screen</dd>
<dt>g</dt>
<dd>back to the start</dd>
<dt/><dd/>
<dt>q, <k name="Esc"/> or <k name="C-c"></k></dt> <dd>stop the listing</dd>
<dt>:</dt> <dd>stop the listing and enter a command line</dd>
<dt>;</dt> <dd>start an <t>extended-hints</t> command</dd>
<dt><k name="C-y"/></dt> <dd>yank (copy) a modeless selection to the clipboard</dd>
<dt>q, <k name="Esc" link="false"/> or <k name="C-c"></k></dt>
<dd>stop the listing</dd>
<dt>:</dt>
<dd>stop the listing and enter a command line</dd>
<dt>;</dt>
<dd>start an <t>extended-hints</t> command</dd>
<dt><k name="C-y" link="false"/></dt>
<dd>yank (copy) a modeless selection to the clipboard</dd>
</dl>
</document>

View File

@@ -548,7 +548,7 @@
<description>
<p>
Set the external text editor.
This is the editor used by <k name="C-i" mode="i"/>, <k>gF</k>, and
This is the editor used by <k name="C-i" mode="I"/>, <k>gF</k>, and
other commands which launch an external text editor.
</p>
@@ -930,7 +930,7 @@
</p>
<p>
TextEdit mode can be entered with <k name="C-t" mode="i"/> from Insert mode.
TextEdit mode can be entered with <k name="C-t" mode="I"/> from Insert mode.
</p>
</description>
</item>

View File

@@ -147,7 +147,7 @@
If no <oa>action</oa> is given, the value of <o>cookies</o> is used.
</p>
<example><ex>:map -b</ex> <k>c</k> <ex>:cookies</ex> <k name="A-Tab"/></example>
<example><ex>:map -b</ex> <k link="false">c</k> <ex>:cookies</ex> <k name="A-Tab" link="false"/></example>
</description>
</item>

View File

@@ -261,7 +261,7 @@
<description>
<p>
Start Caret mode. This mode resembles the Vim's Normal mode where
the text cursor is visible on the web page. The <k>v</k> key
the text cursor is visible on the web page. The <k link="false">v</k> key
enters visual mode, where text is selected as the cursor moves.
</p>
</description>

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)
});

View File

@@ -293,6 +293,7 @@ var Config = Module("config", ConfigBase, {
context.filterFunc = null;
let words = context.filter.toLowerCase().split(/\s+/g);
context.hasItems = true;
context.completions = context.completions.filter(function ({ url, title })
words.every(function (w) (url + " " + title).toLowerCase().indexOf(w) >= 0))
context.incomplete = true;

View File

@@ -141,7 +141,7 @@
<li>Visual bell for errors (<o>visualbell</o>)</li>
<li><link topic="marks">Marks</link> support (<k>m</k><tt>M</tt> to set mark <tt>M</tt>, <k>'</k><tt>M</tt> to jump to it)</li>
<li><link topic="quickmarks">QuickMark</link> support</li>
<li><link topic="i_&lt;C-i>">Editing of text fields</link> with an <link topic="'editor'">external editor</link></li>
<li><link topic="I_&lt;C-i>">Editing of text fields</link> with an <link topic="'editor'">external editor</link></li>
<li><link topic="autocommands">AutoCommands</link> to execute actions on certain events</li>
<li>A comprehensive help system, explaining all <link topic="cmdline.xml">commands</link>, <link topic="mapping">mappings</link>, <t>options</t>, and <t>plugins</t></li>
</ul>

View File

@@ -225,7 +225,7 @@
<p>
Whichever way you choose to indicate your target link, once &dactyl.appName; has
highlighted the link you want, simply hit <k name="Enter"/> to open it.
highlighted the link you want, simply hit <k name="CR"/> to open it.
</p>
<p>