1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 18:47:58 +01:00

Annotate most strings which need to be explicitly localified.

This commit is contained in:
Kris Maglione
2011-03-25 22:37:16 -04:00
parent 75bf52f46f
commit 204f8ca25c
26 changed files with 128 additions and 119 deletions

View File

@@ -203,9 +203,9 @@ var Abbreviations = Module("abbreviations", {
let list = <table> let list = <table>
<tr highlight="Title"> <tr highlight="Title">
<td/> <td/>
<td style="padding-right: 1em;">Mode</td> <td style="padding-right: 1em;"><!--L-->Mode</td>
<td style="padding-right: 1em;">Abbrev</td> <td style="padding-right: 1em;"><!--L-->Abbrev</td>
<td style="padding-right: 1em;">Replacement</td> <td style="padding-right: 1em;"><!--L-->Replacement</td>
</tr> </tr>
<col style="min-width: 6em; padding-right: 1em;"/> <col style="min-width: 6em; padding-right: 1em;"/>
{ {

View File

@@ -404,7 +404,7 @@ var Bookmarks = Module("bookmarks", {
let frames = buffer.allFrames(); let frames = buffer.allFrames();
if (!args.bang) if (!args.bang)
return [ return [
[win.document.title, frames.length == 1 ? "Current Location" : "Frame: " + win.location.href] [win.document.title, frames.length == 1 ? /*L*/"Current Location" : /*L*/"Frame: " + win.location.href]
for ([, win] in Iterator(frames))]; for ([, win] in Iterator(frames))];
context.keys.text = "title"; context.keys.text = "title";
context.keys.description = "url"; context.keys.description = "url";
@@ -464,7 +464,7 @@ var Bookmarks = Module("bookmarks", {
context.title = ["Page URL"]; context.title = ["Page URL"];
let frames = buffer.allFrames(); let frames = buffer.allFrames();
context.completions = [ context.completions = [
[win.document.documentURI, frames.length == 1 ? "Current Location" : "Frame: " + win.document.title] [win.document.documentURI, frames.length == 1 ? /*L*/"Current Location" : /*L*/"Frame: " + win.document.title]
for ([, win] in Iterator(frames))]; for ([, win] in Iterator(frames))];
return; return;
} }
@@ -626,7 +626,7 @@ var Bookmarks = Module("bookmarks", {
if (item && item.url.indexOf("%s") > -1) if (item && item.url.indexOf("%s") > -1)
context.fork("keyword/" + keyword, keyword.length + space.length, null, function (context) { context.fork("keyword/" + keyword, keyword.length + space.length, null, function (context) {
context.format = history.format; context.format = history.format;
context.title = [keyword + " Quick Search"]; context.title = [/*L*/keyword + " Quick Search"];
// context.background = true; // context.background = true;
context.compare = CompletionContext.Sort.unsorted; context.compare = CompletionContext.Sort.unsorted;
context.generate = function () { context.generate = function () {
@@ -671,7 +671,7 @@ var Bookmarks = Module("bookmarks", {
return; return;
let ctxt = context.fork(name, 0); let ctxt = context.fork(name, 0);
ctxt.title = [engine.description + " Suggestions"]; ctxt.title = [/*L*/engine.description + " Suggestions"];
ctxt.keys = { text: util.identity, description: function () "" }; ctxt.keys = { text: util.identity, description: function () "" };
ctxt.compare = CompletionContext.Sort.unsorted; ctxt.compare = CompletionContext.Sort.unsorted;
ctxt.filterFunc = null; ctxt.filterFunc = null;

View File

@@ -75,7 +75,7 @@ var Buffer = Module("buffer", {
} }
if (!verbose && nFeed) if (!verbose && nFeed)
yield nFeed + " feed" + (nFeed > 1 ? "s" : ""); yield nFeed + /*L*/" feed" + (nFeed > 1 ? "s" : "");
}); });
this.addPageInfoSection("g", "General Info", function (verbose) { this.addPageInfoSection("g", "General Info", function (verbose) {
@@ -110,7 +110,7 @@ var Buffer = Module("buffer", {
if (!verbose) { if (!verbose) {
if (pageSize[0]) if (pageSize[0])
yield (pageSize[1] || pageSize[0]) + " bytes"; yield (pageSize[1] || pageSize[0]) + /*L*/" bytes";
yield lastMod; yield lastMod;
return; return;
} }
@@ -171,7 +171,7 @@ var Buffer = Module("buffer", {
if (identity._overrideService.hasMatchingOverride(identity._lastLocation.hostname, if (identity._overrideService.hasMatchingOverride(identity._lastLocation.hostname,
(identity._lastLocation.port || 443), (identity._lastLocation.port || 443),
data.cert, {}, {})) data.cert, {}, {}))
yield ["User exception", "true"] yield ["User exception", /*L*/"true"]
break; break;
} }
}); });
@@ -607,7 +607,7 @@ var Buffer = Module("buffer", {
try { try {
window.urlSecurityCheck(uri.spec, doc.nodePrincipal); window.urlSecurityCheck(uri.spec, doc.nodePrincipal);
io.CommandFileMode("Save link: ", { io.CommandFileMode(/*L*/"Save link: ", {
onSubmit: function (path) { onSubmit: function (path) {
let file = io.File(path); let file = io.File(path);
if (file.exists() && file.isDirectory()) if (file.exists() && file.isDirectory())
@@ -831,7 +831,7 @@ var Buffer = Module("buffer", {
* @param {Node} elem The element to query. * @param {Node} elem The element to query.
*/ */
showElementInfo: function showElementInfo(elem) { showElementInfo: function showElementInfo(elem) {
dactyl.echo(<>Element:<br/>{util.objectToString(elem, true)}</>, commandline.FORCE_MULTILINE); dactyl.echo(<><!--L-->Element:<br/>{util.objectToString(elem, true)}</>, commandline.FORCE_MULTILINE);
}, },
/** /**
@@ -1073,7 +1073,7 @@ var Buffer = Module("buffer", {
scrollColumns: deprecated("buffer.scrollHorizontal", function scrollColumns(cols) buffer.scrollHorizontal("columns", cols)), scrollColumns: deprecated("buffer.scrollHorizontal", function scrollColumns(cols) buffer.scrollHorizontal("columns", cols)),
scrollPages: deprecated("buffer.scrollHorizontal", function scrollPages(pages) buffer.scrollVertical("pages", pages)), scrollPages: deprecated("buffer.scrollHorizontal", function scrollPages(pages) buffer.scrollVertical("pages", pages)),
scrollTo: deprecated("Buffer.scrollTo", function scrollTo(x, y) content.scrollTo(x, y)), scrollTo: deprecated("Buffer.scrollTo", function scrollTo(x, y) content.scrollTo(x, y)),
textZoom: deprecated("buffer.zoomValue and buffer.fullZoom", function textZoom() config.browser.markupDocumentViewer.textZoom * 100) textZoom: deprecated("buffer.zoomValue/buffer.fullZoom", function textZoom() config.browser.markupDocumentViewer.textZoom * 100)
}, { }, {
PageInfo: Struct("PageInfo", "name", "title", "action") PageInfo: Struct("PageInfo", "name", "title", "action")
.localize("title"), .localize("title"),
@@ -1125,13 +1125,13 @@ var Buffer = Module("buffer", {
var names = []; var names = [];
if (node.title) if (node.title)
names.push([node.title, "Page Name"]); names.push([node.title, /*L*/"Page Name"]);
if (node.alt) if (node.alt)
names.push([node.alt, "Alternate Text"]); names.push([node.alt, /*L*/"Alternate Text"]);
if (!isinstance(node, Document) && node.textContent) if (!isinstance(node, Document) && node.textContent)
names.push([node.textContent, "Link Text"]); names.push([node.textContent, /*L*/"Link Text"]);
names.push([decodeURIComponent(url.replace(/.*?([^\/]*)\/*$/, "$1")), "File Name"]); names.push([decodeURIComponent(url.replace(/.*?([^\/]*)\/*$/, "$1")), "File Name"]);
@@ -1534,7 +1534,7 @@ var Buffer = Module("buffer", {
i = i + 1; i = i + 1;
return { return {
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url], text: [i + ": " + (tab.label || /*L*/"(Untitled)"), i + ": " + url],
tab: tab, tab: tab,
id: i - 1, id: i - 1,
url: url, url: url,

View File

@@ -313,7 +313,7 @@ var CommandMode = Class("CommandMode", {
open: function (command) { open: function (command) {
dactyl.assert(isinstance(this.mode, modes.COMMAND_LINE), dactyl.assert(isinstance(this.mode, modes.COMMAND_LINE),
"Not opening command line in non-command-line mode."); /*L*/"Not opening command line in non-command-line mode.");
this.messageCount = commandline.messageCount; this.messageCount = commandline.messageCount;
modes.push(this.mode, this.extendedMode, this.closure); modes.push(this.mode, this.extendedMode, this.closure);
@@ -431,7 +431,7 @@ var CommandExMode = Class("CommandExMode", CommandMode, {
}, },
onSubmit: function onSubmit(command) { onSubmit: function onSubmit(command) {
contexts.withContext({ file: "[Command Line]", line: 1 }, contexts.withContext({ file: /*L*/"[Command Line]", line: 1 },
function _onSubmit() { function _onSubmit() {
io.withSavedValues(["readHeredoc"], function _onSubmit() { io.withSavedValues(["readHeredoc"], function _onSubmit() {
this.readHeredoc = commandline.readHeredoc; this.readHeredoc = commandline.readHeredoc;
@@ -1627,7 +1627,7 @@ var ItemList = Class("ItemList", {
_init: function _init() { _init: function _init() {
this._div = this._dom( this._div = this._dom(
<div class="ex-command-output" highlight="Normal" style="white-space: nowrap"> <div class="ex-command-output" highlight="Normal" style="white-space: nowrap">
<div highlight="Completions" key="noCompletions"><span highlight="Title">No Completions</span></div> <div highlight="Completions" key="noCompletions"><span highlight="Title"><!--L-->No Completions</span></div>
<div key="completions"/> <div key="completions"/>
<div highlight="Completions"> <div highlight="Completions">
{ {

View File

@@ -197,7 +197,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
argCount: "*", argCount: "*",
completer: function (context, args) { completer: function (context, args) {
context.keys.text = util.identity; context.keys.text = util.identity;
context.keys.description = function () seen[this.text] + " matching items"; context.keys.description = function () seen[this.text] + /*L*/" matching items";
let seen = {}; let seen = {};
context.completions = array(item.description.toLowerCase().split(/[()\s]+/) context.completions = array(item.description.toLowerCase().split(/[()\s]+/)
for (item in params.iterate(args))) for (item in params.iterate(args)))
@@ -685,7 +685,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
unescape(encodeURI( // UTF-8 handling hack. unescape(encodeURI( // UTF-8 handling hack.
<document xmlns={NS} <document xmlns={NS}
name="plugins" title={config.appName + " Plugins"}> name="plugins" title={config.appName + " Plugins"}>
<h1 tag="using-plugins">Using Plugins</h1> <h1 tag="using-plugins"><!--L-->Using Plugins</h1>
<toc start="2"/> <toc start="2"/>
{body} {body}
@@ -1010,7 +1010,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
<description>{ <description>{
obj.description ? br + <p>{template.linkifyHelp(obj.description.replace(/\.?$/, "."), true)}</p> : "" }{ obj.description ? br + <p>{template.linkifyHelp(obj.description.replace(/\.?$/, "."), true)}</p> : "" }{
extraHelp ? br + extraHelp : "" }{ extraHelp ? br + extraHelp : "" }{
!(extraHelp || obj.description) ? br + <p>Sorry, no help available.</p> : "" } !(extraHelp || obj.description) ? br + <p><!--L-->Sorry, no help available.</p> : "" }
</description> </description>
</item></>; </item></>;
@@ -1073,7 +1073,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
* These are set and accessed with the "g:" prefix. * These are set and accessed with the "g:" prefix.
*/ */
_globalVariables: {}, _globalVariables: {},
globalVariables: deprecated("the options system", { globalVariables: deprecated(/*L*/"the options system", {
get: function globalVariables() this._globalVariables get: function globalVariables() this._globalVariables
}), }),
@@ -1160,7 +1160,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
onExecute: function onExecute(event) { onExecute: function onExecute(event) {
let cmd = event.originalTarget.getAttribute("dactyl-execute"); let cmd = event.originalTarget.getAttribute("dactyl-execute");
commands.execute(cmd, null, false, null, commands.execute(cmd, null, false, null,
{ file: "[Command Line]", line: 1 }); { file: /*L*/"[Command Line]", line: 1 });
}, },
/** /**
@@ -1962,7 +1962,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
commandline.commandOutput( commandline.commandOutput(
<table> <table>
<tr highlight="Title" align="left"> <tr highlight="Title" align="left">
<th colspan="3">Code execution summary</th> <th colspan="3"><!--L-->Code execution summary</th>
</tr> </tr>
<tr><td>&#xa0;&#xa0;Executed:</td><td align="right"><span class="times-executed">{count}</span></td><td>times</td></tr> <tr><td>&#xa0;&#xa0;Executed:</td><td align="right"><span class="times-executed">{count}</span></td><td>times</td></tr>
<tr><td>&#xa0;&#xa0;Average time:</td><td align="right"><span class="time-average">{each.toFixed(2)}</span></td><td>{eachUnits}</td></tr> <tr><td>&#xa0;&#xa0;Average time:</td><td align="right"><span class="time-average">{each.toFixed(2)}</span></td><td>{eachUnits}</td></tr>

View File

@@ -321,7 +321,7 @@ var Editor = Module("editor", {
try { try {
var tmpfile = io.createTempFile(); var tmpfile = io.createTempFile();
if (!tmpfile) if (!tmpfile)
throw Error("Couldn't create temporary file"); throw Error(/*L*/"Couldn't create temporary file");
if (textBox) { if (textBox) {
highlight.highlightNode(textBox, origGroup + " EditorEditing"); highlight.highlightNode(textBox, origGroup + " EditorEditing");
@@ -329,7 +329,7 @@ var Editor = Module("editor", {
} }
if (!tmpfile.write(text)) if (!tmpfile.write(text))
throw Error("Input contains characters not valid in the current " + throw Error(/*L*/"Input contains characters not valid in the current " +
"file encoding"); "file encoding");
var lastUpdate = Date.now(); var lastUpdate = Date.now();

View File

@@ -185,7 +185,7 @@
<xsl:if test="//dactyl:toc[1 and self::*]"> <xsl:if test="//dactyl:toc[1 and self::*]">
<div dactyl:highlight="HelpTOC"> <div dactyl:highlight="HelpTOC">
<h2>Contents</h2> <h2><!--L-->Contents</h2>
<xsl:if test="@start"> <xsl:if test="@start">
<xsl:call-template name="toc"> <xsl:call-template name="toc">
<xsl:with-param name="level" select="number(@start)"/> <xsl:with-param name="level" select="number(@start)"/>
@@ -240,7 +240,7 @@
</xsl:when> </xsl:when>
<xsl:when test="contains($type, 'list') or contains($type, 'map')"> <xsl:when test="contains($type, 'list') or contains($type, 'map')">
<span dactyl:highlight="HelpString" delim=""><xsl:apply-templates mode="help-1"/></span> <span dactyl:highlight="HelpString" delim=""><xsl:apply-templates mode="help-1"/></span>
<xsl:if test=". = ''">(empty)</xsl:if> <xsl:if test=". = ''"><!--L-->(empty)</xsl:if>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<span> <span>
@@ -430,7 +430,7 @@
<xsl:template match="dactyl:deprecated" mode="help-2"> <xsl:template match="dactyl:deprecated" mode="help-2">
<p style="clear: both;"> <p style="clear: both;">
<xsl:apply-templates select="@*" mode="help-1"/> <xsl:apply-templates select="@*" mode="help-1"/>
<span dactyl:highlight="HelpWarning">Deprecated:</span> <span dactyl:highlight="HelpWarning"><!--L-->Deprecated:</span>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:apply-templates select="node()" mode="help-1"/> <xsl:apply-templates select="node()" mode="help-1"/>
</p> </p>
@@ -439,7 +439,7 @@
<p style="clear: both;"> <p style="clear: both;">
<xsl:apply-templates select="@*" mode="help-1"/> <xsl:apply-templates select="@*" mode="help-1"/>
<div style="clear: both;"/> <div style="clear: both;"/>
<span dactyl:highlight="HelpNote">Note:</span> <span dactyl:highlight="HelpNote"><!--L-->Note:</span>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:apply-templates select="node()" mode="help-1"/> <xsl:apply-templates select="node()" mode="help-1"/>
</p> </p>
@@ -448,7 +448,7 @@
<p style="clear: both;"> <p style="clear: both;">
<xsl:apply-templates select="@*" mode="help-1"/> <xsl:apply-templates select="@*" mode="help-1"/>
<div style="clear: both;"/> <div style="clear: both;"/>
<span dactyl:highlight="HelpWarning">Warning:</span> <span dactyl:highlight="HelpWarning"><!--L-->Warning:</span>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:apply-templates select="node()" mode="help-1"/> <xsl:apply-templates select="node()" mode="help-1"/>
</p> </p>

View File

@@ -219,7 +219,7 @@ var History = Module("history", {
description: "The sort order of the results", description: "The sort order of the results",
completer: function (context, args) { completer: function (context, args) {
context.compare = CompletionContext.Sort.unsorted; context.compare = CompletionContext.Sort.unsorted;
return array.flatten([ return /*L*/array.flatten([
"annotation", "annotation",
"date", "date",
"date added", "date added",

View File

@@ -168,7 +168,7 @@ var MapHive = Class("MapHive", Contexts.Hive, {
modes = Array.concat(modes); modes = Array.concat(modes);
if (!modes.every(util.identity)) if (!modes.every(util.identity))
throw TypeError("Invalid modes: " + modes); throw TypeError(/*L*/"Invalid modes: " + modes);
let map = Map(modes, keys, description, action, extra); let map = Map(modes, keys, description, action, extra);
map.definedAt = contexts.getCaller(Components.stack.caller); map.definedAt = contexts.getCaller(Components.stack.caller);
@@ -431,9 +431,9 @@ var Mappings = Module("mappings", {
let list = <table> let list = <table>
<tr highlight="Title"> <tr highlight="Title">
<td/> <td/>
<td style="padding-right: 1em;">Mode</td> <td style="padding-right: 1em;"><!--L-->Mode</td>
<td style="padding-right: 1em;">Command</td> <td style="padding-right: 1em;"><!--L-->Command</td>
<td style="padding-right: 1em;">Action</td> <td style="padding-right: 1em;"><!--L-->Action</td>
</tr> </tr>
<col style="min-width: 6em; padding-right: 1em;"/> <col style="min-width: 6em; padding-right: 1em;"/>
{ {
@@ -531,7 +531,7 @@ var Mappings = Module("mappings", {
{ {
names: ["-description", "-desc", "-d"], names: ["-description", "-desc", "-d"],
description: "A description of this mapping", description: "A description of this mapping",
default: "User-defined mapping", default: /*L*/"User-defined mapping",
type: CommandOption.STRING type: CommandOption.STRING
}, },
{ {

View File

@@ -53,16 +53,16 @@ var MOW = Module("mow", {
<popupset> <popupset>
<menupopup id="dactyl-contextmenu" highlight="Events" events="contextEvents"> <menupopup id="dactyl-contextmenu" highlight="Events" events="contextEvents">
<menuitem id="dactyl-context-copylink" <menuitem id="dactyl-context-copylink"
label="Copy Link Location" dactyl:group="link" label={/*L*/"Copy Link Location"} dactyl:group="link"
oncommand="goDoCommand('cmd_copyLink');"/> oncommand="goDoCommand('cmd_copyLink');"/>
<menuitem id="dactyl-context-copypath" <menuitem id="dactyl-context-copypath"
label="Copy File Path" dactyl:group="link path" label={/*L*/"Copy File Path"} dactyl:group="link path"
oncommand="dactyl.clipboardWrite(document.popupNode.getAttribute('path'));"/> oncommand="dactyl.clipboardWrite(document.popupNode.getAttribute('path'));"/>
<menuitem id="dactyl-context-copy" <menuitem id="dactyl-context-copy"
label="Copy" dactyl:group="selection" label={/*L*/"Copy"} dactyl:group="selection"
command="cmd_copy"/> command="cmd_copy"/>
<menuitem id="dactyl-context-selectall" <menuitem id="dactyl-context-selectall"
label="Select All" label={/*L*/"Select All"}
command="cmd_selectAll"/> command="cmd_selectAll"/>
</menupopup> </menupopup>
</popupset> </popupset>

View File

@@ -157,7 +157,7 @@ var QuickMarks = Module("quickmarks", {
context.fork("current", 0, this, function (context) { context.fork("current", 0, this, function (context) {
context.title = ["Extra Completions"]; context.title = ["Extra Completions"];
context.completions = [ context.completions = [
[quickmarks.get(args[0]), "Current Value"] [quickmarks.get(args[0]), _("option.currentValue")]
].filter(function ([k, v]) k); ].filter(function ([k, v]) k);
}); });
context.fork("url", 0, completion, "url"); context.fork("url", 0, completion, "url");

View File

@@ -308,7 +308,7 @@ var StatusLine = Module("statusline", {
else if (typeof progress == "number") { else if (typeof progress == "number") {
let progressStr = ""; let progressStr = "";
if (this._progress <= 0) if (this._progress <= 0)
progressStr = "[ Loading... ]"; progressStr = /*L*/"[ Loading... ]";
else if (this._progress < 1) { else if (this._progress < 1) {
let progress = Math.round(this._progress * 20); let progress = Math.round(this._progress * 20);
progressStr = "[" progressStr = "["

View File

@@ -282,11 +282,11 @@ var AddonList = Class("AddonList", {
XML.ignoreWhitespace = true; XML.ignoreWhitespace = true;
util.xmlToDom(<table highlight="Addons" key="list" xmlns={XHTML}> util.xmlToDom(<table highlight="Addons" key="list" xmlns={XHTML}>
<tr highlight="AddonHead"> <tr highlight="AddonHead">
<td>Name</td> <td><!--L-->Name</td>
<td>Version</td> <td><!--L-->Version</td>
<td>Status</td> <td><!--L-->Status</td>
<td/> <td/>
<td>Description</td> <td><!--L-->Description</td>
</tr> </tr>
</table>, this.document, this.nodes); </table>, this.document, this.nodes);

View File

@@ -657,11 +657,11 @@ var Commands = Module("commands", {
<tr highlight="Title"> <tr highlight="Title">
<td/> <td/>
<td style="padding-right: 1em;"></td> <td style="padding-right: 1em;"></td>
<td style="padding-right: 1ex;">Name</td> <td style="padding-right: 1ex;"><!--L-->Name</td>
<td style="padding-right: 1ex;">Args</td> <td style="padding-right: 1ex;"><!--L-->Args</td>
<td style="padding-right: 1ex;">Range</td> <td style="padding-right: 1ex;"><!--L-->Range</td>
<td style="padding-right: 1ex;">Complete</td> <td style="padding-right: 1ex;"><!--L-->Complete</td>
<td style="padding-right: 1ex;">Definition</td> <td style="padding-right: 1ex;"><!--L-->Definition</td>
</tr> </tr>
<col style="min-width: 6em; padding-right: 1em;"/> <col style="min-width: 6em; padding-right: 1em;"/>
{ {

View File

@@ -960,7 +960,7 @@ var Completion = Module("completion", {
context.title = ["URL", "Title"]; context.title = ["URL", "Title"];
context.fork("additional", 0, this, function (context) { context.fork("additional", 0, this, function (context) {
context.title[0] += " (additional)"; context.title[0] += /*L*/" (additional)";
context.filter = context.parent.filter; // FIXME context.filter = context.parent.filter; // FIXME
context.completions = context.parent.completions; context.completions = context.parent.completions;
// For items whose URL doesn't exactly match the filter, // For items whose URL doesn't exactly match the filter,

View File

@@ -159,7 +159,7 @@ var ConfigBase = Class("ConfigBase", {
"--template=hg{rev}-" + this.branch + " ({date|isodate})"]).output; "--template=hg{rev}-" + this.branch + " ({date|isodate})"]).output;
let version = this.addon.version; let version = this.addon.version;
if ("@DATE@" !== "@" + "DATE@") if ("@DATE@" !== "@" + "DATE@")
version += " (created: @DATE@)"; version += /*L*/" (created: @DATE@)";
return version; return version;
}), }),
@@ -624,7 +624,7 @@ var ConfigBase = Class("ConfigBase", {
HelpEx;;;FontCode display: inline-block; color: #527BBD; HelpEx;;;FontCode display: inline-block; color: #527BBD;
HelpExample display: block; margin: 1em 0; HelpExample display: block; margin: 1em 0;
HelpExample::before content: "Example: "; font-weight: bold; HelpExample::before content: /*L*/"Example: "; font-weight: bold;
HelpInfo display: block; width: 20em; margin-left: auto; HelpInfo display: block; width: 20em; margin-left: auto;
HelpInfoLabel display: inline-block; width: 6em; color: magenta; font-weight: bold; vertical-align: text-top; HelpInfoLabel display: inline-block; width: 6em; color: magenta; font-weight: bold; vertical-align: text-top;

View File

@@ -137,7 +137,7 @@ var Download = Class("Download", {
if (this.timeRemaining) if (this.timeRemaining)
this.nodes.time.textContent = util.formatSeconds(this.timeRemaining); this.nodes.time.textContent = util.formatSeconds(this.timeRemaining);
else else
this.nodes.time.textContent = "~1 second"; this.nodes.time.textContent = /*L*/"~1 second";
} }
let total = this.nodes.progressTotal.textContent = this.size ? util.formatBytes(this.size, 1, true) : "Unknown"; let total = this.nodes.progressTotal.textContent = this.size ? util.formatBytes(this.size, 1, true) : "Unknown";
let suffix = RegExp(/( [a-z]+)?$/i.exec(total)[0] + "$"); let suffix = RegExp(/( [a-z]+)?$/i.exec(total)[0] + "$");
@@ -182,20 +182,20 @@ var DownloadList = Class("DownloadList",
util.xmlToDom(<table highlight="Downloads" key="list" xmlns={XHTML}> util.xmlToDom(<table highlight="Downloads" key="list" xmlns={XHTML}>
<tr highlight="DownloadHead"> <tr highlight="DownloadHead">
<span>Title</span> <span><!--L-->Title</span>
<span>Status</span> <span><!--L-->Status</span>
<span/> <span/>
<span>Progress</span> <span><!--L-->Progress</span>
<span/> <span/>
<span>Time remaining</span> <span><!--L-->Time remaining</span>
<span>Source</span> <span><!--L-->Source</span>
</tr> </tr>
<tr highlight="Download"><span><div style="min-height: 1ex; /* FIXME */"/></span></tr> <tr highlight="Download"><span><div style="min-height: 1ex; /* FIXME */"/></span></tr>
<tr highlight="Download" key="totals" active="true"> <tr highlight="Download" key="totals" active="true">
<td><span highlight="Title">Totals:</span>&#xa0;<span key="total"/></td> <td><span highlight="Title"><!--L-->Totals:</span>&#xa0;<span key="total"/></td>
<td/> <td/>
<td highlight="DownloadButtons"> <td highlight="DownloadButtons">
<a highlight="Button" key="clear">Clear</a> <a highlight="Button" key="clear"><!--L-->Clear</a>
</td> </td>
<td highlight="DownloadProgress" key="progress"> <td highlight="DownloadProgress" key="progress">
<span highlight="DownloadProgressHave" key="progressHave" <span highlight="DownloadProgressHave" key="progressHave"
@@ -277,7 +277,7 @@ var DownloadList = Class("DownloadList",
let active = downloads.filter(function (dl) dl.alive).length; let active = downloads.filter(function (dl) dl.alive).length;
if (active) if (active)
this.nodes.total.textContent = active + " active"; this.nodes.total.textContent = /*L*/active + " active";
else for (let key in values(["total", "percent", "time"])) else for (let key in values(["total", "percent", "time"]))
this.nodes[key].textContent = ""; this.nodes[key].textContent = "";
}, },

View File

@@ -369,7 +369,10 @@ var Highlights = Module("Highlight", {
else if (args.completeArg == 1) { else if (args.completeArg == 1) {
let hl = highlight.get(args[0]); let hl = highlight.get(args[0]);
if (hl) if (hl)
context.completions = [[hl.value, "Current Value"], [hl.defaultValue || "", "Default Value"]]; context.completions = [
[hl.value, _("option.currentValue")],
[hl.defaultValue || "", _("option.defaultValue")]
];
context.fork("css", 0, completion, "css"); context.fork("css", 0, completion, "css");
} }
}, },

View File

@@ -208,7 +208,7 @@ var IO = Module("io", {
} }
catch (e) { catch (e) {
dactyl.reportError(e); dactyl.reportError(e);
let message = "Sourcing file: " + (e.echoerr || file.path + ": " + e); let message = /*L*/"Sourcing file: " + (e.echoerr || file.path + ": " + e);
if (!params.silent) if (!params.silent)
dactyl.echoerr(message); dactyl.echoerr(message);
} }
@@ -831,7 +831,7 @@ unlet s:cpo_save
let result = io.system(arg); let result = io.system(arg);
if (result.returnValue != 0) if (result.returnValue != 0)
result.output += "\nshell returned " + result.returnValue; result.output += /*L*/"\nshell returned " + result.returnValue;
modules.commandline.command = "!" + arg; modules.commandline.command = "!" + arg;
modules.commandline.commandOutput(<span highlight="CmdOutput">{result.output}</span>); modules.commandline.commandOutput(<span highlight="CmdOutput">{result.output}</span>);
@@ -981,9 +981,9 @@ unlet s:cpo_save
context.key = match.prefix; context.key = match.prefix;
context.advance(match.prefix.length + 1); context.advance(match.prefix.length + 1);
context.generate = function () iter({ context.generate = function () iter({
content: "Chrome content", content: /*L*/"Chrome content",
locale: "Locale-specific content", locale: /*L*/"Locale-specific content",
skin: "Theme-specific content" skin: /*L*/"Theme-specific content"
}); });
} }
} }

View File

@@ -45,7 +45,7 @@ var JavaScript = Module("javascript", {
}), }),
globals: Class.memoize(function () [ globals: Class.memoize(function () [
[this.modules.userContext, "Global Variables"], [this.modules.userContext, /*L*/"Global Variables"],
[this.modules, "modules"], [this.modules, "modules"],
[this.window, "window"] [this.window, "window"]
]), ]),
@@ -120,9 +120,9 @@ var JavaScript = Module("javascript", {
context[JavaScript.EVAL_EXPORT] = function export_(obj) cache[key] = obj; context[JavaScript.EVAL_EXPORT] = function export_(obj) cache[key] = obj;
try { try {
if (tmp != null) // Temporary hack until bug 609949 is fixed. if (tmp != null) // Temporary hack until bug 609949 is fixed.
this.modules.dactyl.userEval(JavaScript.EVAL_EXPORT + "(" + arg + ")", context, "[Command Line Completion]", 1); this.modules.dactyl.userEval(JavaScript.EVAL_EXPORT + "(" + arg + ")", context, /*L*/"[Command Line Completion]", 1);
else else
cache[key] = this.modules.dactyl.userEval(arg, context, "[Command Line Completion]", 1); cache[key] = this.modules.dactyl.userEval(arg, context, /*L*/"[Command Line Completion]", 1);
return cache[key]; return cache[key];
} }
@@ -170,7 +170,7 @@ var JavaScript = Module("javascript", {
if (this._top.char != arg) { if (this._top.char != arg) {
this.context.highlight(this._top.offset, this._i - this._top.offset, "SPELLCHECK"); this.context.highlight(this._top.offset, this._i - this._top.offset, "SPELLCHECK");
throw Error("Invalid JS"); throw Error(/*L*/"Invalid JS");
} }
// The closing character of this stack frame will have pushed a new // The closing character of this stack frame will have pushed a new
@@ -308,7 +308,7 @@ var JavaScript = Module("javascript", {
if (this._checkFunction(prev, dot, cacheKey)) if (this._checkFunction(prev, dot, cacheKey))
return []; return [];
if (prev != statement && obj == null) { if (prev != statement && obj == null) {
this.context.message = "Error: " + cacheKey.quote() + " is " + String(obj); this.context.message = /*L*/"Error: " + cacheKey.quote() + " is " + String(obj);
return []; return [];
} }
@@ -324,7 +324,7 @@ var JavaScript = Module("javascript", {
let end = (frame == -1 ? this._lastIdx : this._get(frame + 1).offset); let end = (frame == -1 ? this._lastIdx : this._get(frame + 1).offset);
this._cacheKey = null; this._cacheKey = null;
let obj = [[this.cache.evalContext, "Local Variables"]].concat(this.globals); let obj = [[this.cache.evalContext, /*L*/"Local Variables"]].concat(this.globals);
// Is this an object dereference? // Is this an object dereference?
if (dot < statement) // No. if (dot < statement) // No.
dot = statement - 1; dot = statement - 1;
@@ -339,7 +339,7 @@ var JavaScript = Module("javascript", {
const self = this; const self = this;
if (!getOwnPropertyNames && !services.debugger.isOn && !this.context.message) if (!getOwnPropertyNames && !services.debugger.isOn && !this.context.message)
this.context.message = "For better completion data, please enable the JavaScript debugger (:set jsdebugger)"; this.context.message = /*L*/"For better completion data, please enable the JavaScript debugger (:set jsdebugger)";
let base = this.context.fork("js", this._top.offset); let base = this.context.fork("js", this._top.offset);
base.forceAnchored = true; base.forceAnchored = true;
@@ -419,14 +419,14 @@ var JavaScript = Module("javascript", {
objects.forEach(function (obj) { objects.forEach(function (obj) {
obj.ctxt_p.split(obj[1] + "/anchored", this, function (context) { obj.ctxt_p.split(obj[1] + "/anchored", this, function (context) {
context.anchored = true; context.anchored = true;
context.title[0] += " (prototypes)"; context.title[0] += /*L*/" (prototypes)";
}); });
}); });
objects.forEach(function (obj) { objects.forEach(function (obj) {
obj.ctxt_t.split(obj[1] + "/unanchored", this, function (context) { obj.ctxt_t.split(obj[1] + "/unanchored", this, function (context) {
context.anchored = false; context.anchored = false;
context.title[0] += " (substrings)"; context.title[0] += /*L*/" (substrings)";
context.filters.push(unanchored); context.filters.push(unanchored);
}); });
}); });
@@ -434,7 +434,7 @@ var JavaScript = Module("javascript", {
objects.forEach(function (obj) { objects.forEach(function (obj) {
obj.ctxt_p.split(obj[1] + "/unanchored", this, function (context) { obj.ctxt_p.split(obj[1] + "/unanchored", this, function (context) {
context.anchored = false; context.anchored = false;
context.title[0] += " (prototype substrings)"; context.title[0] += /*L*/" (prototype substrings)";
context.filters.push(unanchored); context.filters.push(unanchored);
}); });
}); });
@@ -775,8 +775,8 @@ var JavaScript = Module("javascript", {
this.js.newContext = function newContext() modules.newContext(self.context, !sandbox); this.js.newContext = function newContext() modules.newContext(self.context, !sandbox);
this.js.globals = [ this.js.globals = [
[this.context, "REPL Variables"], [this.context, /*L*/"REPL Variables"],
[context, "REPL Global"] [context, /*L*/"REPL Global"]
].concat(this.js.globals.filter(function ([global]) isPrototypeOf.call(global, context))); ].concat(this.js.globals.filter(function ([global]) isPrototypeOf.call(global, context)));
if (!isPrototypeOf.call(modules.jsmodules, context)) if (!isPrototypeOf.call(modules.jsmodules, context))

View File

@@ -115,7 +115,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
} }
}; };
return template.options(config.host + " Preferences", prefs.call(this)); return template.options(/*L*/config.host + " Preferences", prefs.call(this));
}, },
/** /**
@@ -219,8 +219,8 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
function assertType(needType) function assertType(needType)
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 ? /*L*/"E521: Number required after =: " + name + "=" + value
: "E474: Invalid argument: " + name + "=" + value); : /*L*/"E474: Invalid argument: " + name + "=" + value);
let type = this.branch.getPrefType(name); let type = this.branch.getPrefType(name);
switch (typeof value) { switch (typeof value) {

View File

@@ -183,7 +183,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
append: { append: {
SanitizeDialogPane: SanitizeDialogPane:
<groupbox orient="horizontal" xmlns={XUL}> <groupbox orient="horizontal" xmlns={XUL}>
<caption label={config.appName + " (see :help privacy)"}/> <caption label={config.appName + /*L*/" (see :help privacy)"}/>
<grid flex="1"> <grid flex="1">
<columns><column flex="1"/><column flex="1"/></columns> <columns><column flex="1"/><column flex="1"/></columns>
<rows>{ <rows>{
@@ -204,7 +204,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
function (win) prefOverlay(branch, false, { function (win) prefOverlay(branch, false, {
append: { append: {
itemList: <> itemList: <>
<listitem xmlns={XUL} label="See :help privacy for the following:" disabled="true" style="font-style: italic; font-weight: bold;"/> <listitem xmlns={XUL} label={/*L*/"See :help privacy for the following:"} disabled="true" style="font-style: italic; font-weight: bold;"/>
{ {
template.map(ourItems(), function ([item, desc]) template.map(ourItems(), function ([item, desc])
<listitem xmlns={XUL} type="checkbox" <listitem xmlns={XUL} type="checkbox"
@@ -343,16 +343,18 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
deny: 2, deny: 2,
session: 8 session: 8
}, },
UNPERMS: Class.memoize(function () iter(this.PERMS).map(Array.reverse).toObject()), UNPERMS: Class.memoize(function () iter(this.PERMS).map(Array.reverse).toObject()),
COMMANDS: { COMMANDS: {
unset: "Unset", unset: /*L*/"Unset",
allow: "Allowed", allow: /*L*/"Allowed",
deny: "Denied", deny: /*L*/"Denied",
session: "Allowed for the current session", session: /*L*/"Allowed for the current session",
list: "List all cookies for domain", list: /*L*/"List all cookies for domain",
clear: "Clear all cookies for domain", clear: /*L*/"Clear all cookies for domain",
"clear-persistent": "Clear all persistent cookies for domain", "clear-persistent": /*L*/"Clear all persistent cookies for domain",
"clear-session": "Clear all session cookies for domain" "clear-session": /*L*/"Clear all session cookies for domain"
}, },
argPrefMap: { argPrefMap: {

View File

@@ -321,9 +321,9 @@ var File = Class("File", {
*/ */
iterDirectory: function () { iterDirectory: function () {
if (!this.exists()) if (!this.exists())
throw Error("File does not exist"); throw Error(/*L*/"File does not exist");
if (!this.isDirectory()) if (!this.isDirectory())
throw Error("Not a directory"); throw Error(/*L*/"Not a directory");
for (let file in iter(this.directoryEntries)) for (let file in iter(this.directoryEntries))
yield File(file); yield File(file);
}, },
@@ -362,7 +362,7 @@ var File = Class("File", {
*/ */
readDirectory: function (sort) { readDirectory: function (sort) {
if (!this.isDirectory()) if (!this.isDirectory())
throw Error("Not a directory"); throw Error(/*L*/"Not a directory");
let array = [e for (e in this.iterDirectory())]; let array = [e for (e in this.iterDirectory())];
if (sort) if (sort)
@@ -515,7 +515,7 @@ var File = Class("File", {
DoesNotExist: function (path, error) ({ DoesNotExist: function (path, error) ({
path: path, path: path,
exists: function () false, exists: function () false,
__noSuchMethod__: function () { throw error || Error("Does not exist"); } __noSuchMethod__: function () { throw error || Error(/*L*/"Does not exist"); }
}), }),
defaultEncoding: "UTF-8", defaultEncoding: "UTF-8",

View File

@@ -312,9 +312,9 @@ var Styles = Module("Styles", {
<tr highlight="Title"> <tr highlight="Title">
<td/> <td/>
<td/> <td/>
<td style="padding-right: 1em;">Name</td> <td style="padding-right: 1em;"><!--L-->Name</td>
<td style="padding-right: 1em;">Filter</td> <td style="padding-right: 1em;"><!--L-->Filter</td>
<td style="padding-right: 1em;">CSS</td> <td style="padding-right: 1em;"><!--L-->CSS</td>
</tr> </tr>
<col style="min-width: 4em; padding-right: 1em;"/> <col style="min-width: 4em; padding-right: 1em;"/>
<col style="min-width: 1em; text-align: center; color: red; font-weight: bold;"/> <col style="min-width: 1em; text-align: center; color: red; font-weight: bold;"/>
@@ -377,8 +377,8 @@ var Styles = Module("Styles", {
context.fork("current", 0, this, function (context) { context.fork("current", 0, this, function (context) {
context.title = ["Current Site"]; context.title = ["Current Site"];
context.completions = [ context.completions = [
[content.location.host, "Current Host"], [content.location.host, /*L*/"Current Host"],
[content.location.href, "Current URL"] [content.location.href, /*L*/"Current URL"]
]; ];
}); });
} }
@@ -389,7 +389,7 @@ var Styles = Module("Styles", {
context.generate = function () values(group.sites); context.generate = function () values(group.sites);
context.keys.text = util.identity; context.keys.text = util.identity;
context.keys.description = function (site) this.sheets.length + " sheet" + (this.sheets.length == 1 ? "" : "s") + ": " + context.keys.description = function (site) this.sheets.length + /*L*/" sheet" + (this.sheets.length == 1 ? "" : "s") + ": " +
array.compact(this.sheets.map(function (s) s.name)).join(", "); array.compact(this.sheets.map(function (s) s.name)).join(", ");
context.keys.sheets = function (site) group.sheets.filter(function (s) s.sites.indexOf(site) >= 0); context.keys.sheets = function (site) group.sheets.filter(function (s) s.sites.indexOf(site) >= 0);
context.keys.active = function (site) uris.some(Styles.matchFilter(site)); context.keys.active = function (site) uris.some(Styles.matchFilter(site));
@@ -434,7 +434,7 @@ var Styles = Module("Styles", {
for (let item in Iterator({ Active: true, Inactive: false })) { for (let item in Iterator({ Active: true, Inactive: false })) {
let [name, active] = item; let [name, active] = item;
context.split(name, null, function (context) { context.split(name, null, function (context) {
context.title[0] = name + " " + (title || "Sheets"); context.title[0] = /*L*/name + " " + (title || "Sheets");
context.filters.push(function (item) !!item.active == active); context.filters.push(function (item) !!item.active == active);
}); });
} }
@@ -584,7 +584,9 @@ var Styles = Module("Styles", {
} }
else if (args.completeArg == 1) { else if (args.completeArg == 1) {
if (sheet) if (sheet)
context.completions = [[sheet.css, "Current Value"]]; context.completions = [
[sheet.css, _("option.currentValue")]
];
context.fork("css", 0, modules.completion, "css"); context.fork("css", 0, modules.completion, "css");
} }
}, },

View File

@@ -363,7 +363,9 @@ var Template = Module("Template", {
// <e4x> // <e4x>
return <table> return <table>
<tr style="text-align: left;" highlight="Title"> <tr style="text-align: left;" highlight="Title">
<th colspan="2">jump</th><th>title</th><th>URI</th> <th colspan="2"><!--L-->Jump</th>
<th><!--L-->Title</th>
<th><!--L-->URI</th>
</tr> </tr>
{ {
this.map(Iterator(elems), function ([idx, val]) this.map(Iterator(elems), function ([idx, val])
@@ -494,7 +496,7 @@ var Template = Module("Template", {
let (name = item.name || item.names[0], frame = item.definedAt) let (name = item.name || item.names[0], frame = item.definedAt)
!frame ? name : !frame ? name :
template.helpLink(help(item), name, "Title") + template.helpLink(help(item), name, "Title") +
<span highlight="LinkInfo" xmlns:dactyl={NS}>Defined at {sourceLink(frame)}</span> <span highlight="LinkInfo" xmlns:dactyl={NS}><!--L-->Defined at {sourceLink(frame)}</span>
}</span> }</span>
</td> </td>
{ item.columns ? template.map(item.columns, function (c) <td>{c}</td>) : "" } { item.columns ? template.map(item.columns, function (c) <td>{c}</td>) : "" }

View File

@@ -309,7 +309,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
} }
else if (char === "]") { else if (char === "]") {
stack.pop(); stack.pop();
util.assert(stack.length, "Unmatched %] in format"); util.assert(stack.length, /*L*/"Unmatched %] in format");
} }
else { else {
let quote = function quote(obj, char) obj[char]; let quote = function quote(obj, char) obj[char];
@@ -328,7 +328,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
if (end < format.length) if (end < format.length)
stack.top.elements.push(format.substr(end)); stack.top.elements.push(format.substr(end));
util.assert(stack.length === 1, "Unmatched %[ in format"); util.assert(stack.length === 1, /*L*/"Unmatched %[ in format");
return stack.top; return stack.top;
}, },
@@ -375,7 +375,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
} }
else if (close) { else if (close) {
stack.pop(); stack.pop();
util.assert(stack.length, "Unmatched %] in macro"); util.assert(stack.length, /*L*/"Unmatched %] in macro");
} }
else { else {
let [, flags, name] = /^((?:[a-z]-)*)(.*)/.exec(macro); let [, flags, name] = /^((?:[a-z]-)*)(.*)/.exec(macro);
@@ -402,7 +402,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
if (end < macro.length) if (end < macro.length)
stack.top.elements.push(macro.substr(end)); stack.top.elements.push(macro.substr(end));
util.assert(stack.length === 1, "Unmatched <{ in macro"); util.assert(stack.length === 1, /*L*/"Unmatched <{ in macro");
return stack.top; return stack.top;
}, },
@@ -759,12 +759,12 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
[hours, minutes] = div(minutes, 60); [hours, minutes] = div(minutes, 60);
[days, hours] = div(hours, 24); [days, hours] = div(hours, 24);
if (days) if (days)
return days + " days " + hours + " hours" return /*L*/days + " days " + hours + " hours"
if (hours) if (hours)
return hours + "h " + minutes + "m"; return /*L*/hours + "h " + minutes + "m";
if (minutes) if (minutes)
return minutes + ":" + pad(2, seconds); return /*L*/minutes + ":" + pad(2, seconds);
return seconds + "s"; return /*L*/seconds + "s";
}, },
/** /**