diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-03-25 22:37:16 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-03-25 22:37:16 -0400 |
commit | 204f8ca25c713e3420023786c37a31385bdbc4f3 (patch) | |
tree | a14eda819a197d61ef93ea17068b555c63dd577e | |
parent | 75bf52f46f272c5e1db885648aad6ab768657ccc (diff) | |
download | pentadactyl-204f8ca25c713e3420023786c37a31385bdbc4f3.tar.gz |
Annotate most strings which need to be explicitly localified.
-rw-r--r-- | common/content/abbreviations.js | 6 | ||||
-rw-r--r-- | common/content/bookmarks.js | 8 | ||||
-rw-r--r-- | common/content/buffer.js | 20 | ||||
-rw-r--r-- | common/content/commandline.js | 6 | ||||
-rw-r--r-- | common/content/dactyl.js | 12 | ||||
-rw-r--r-- | common/content/editor.js | 4 | ||||
-rw-r--r-- | common/content/help.xsl | 10 | ||||
-rw-r--r-- | common/content/history.js | 2 | ||||
-rw-r--r-- | common/content/mappings.js | 10 | ||||
-rw-r--r-- | common/content/mow.js | 8 | ||||
-rw-r--r-- | common/content/quickmarks.js | 2 | ||||
-rw-r--r-- | common/content/statusline.js | 2 | ||||
-rw-r--r-- | common/modules/addons.jsm | 8 | ||||
-rw-r--r-- | common/modules/commands.jsm | 10 | ||||
-rw-r--r-- | common/modules/completion.jsm | 2 | ||||
-rw-r--r-- | common/modules/config.jsm | 4 | ||||
-rw-r--r-- | common/modules/downloads.jsm | 18 | ||||
-rw-r--r-- | common/modules/highlight.jsm | 5 | ||||
-rw-r--r-- | common/modules/io.jsm | 10 | ||||
-rw-r--r-- | common/modules/javascript.jsm | 24 | ||||
-rw-r--r-- | common/modules/prefs.jsm | 6 | ||||
-rw-r--r-- | common/modules/sanitizer.jsm | 22 | ||||
-rw-r--r-- | common/modules/storage.jsm | 8 | ||||
-rw-r--r-- | common/modules/styles.jsm | 18 | ||||
-rw-r--r-- | common/modules/template.jsm | 6 | ||||
-rw-r--r-- | common/modules/util.jsm | 16 |
26 files changed, 128 insertions, 119 deletions
diff --git a/common/content/abbreviations.js b/common/content/abbreviations.js index 9a76fa37..4314abe9 100644 --- a/common/content/abbreviations.js +++ b/common/content/abbreviations.js @@ -203,9 +203,9 @@ var Abbreviations = Module("abbreviations", { let list = <table> <tr highlight="Title"> <td/> - <td style="padding-right: 1em;">Mode</td> - <td style="padding-right: 1em;">Abbrev</td> - <td style="padding-right: 1em;">Replacement</td> + <td style="padding-right: 1em;"><!--L-->Mode</td> + <td style="padding-right: 1em;"><!--L-->Abbrev</td> + <td style="padding-right: 1em;"><!--L-->Replacement</td> </tr> <col style="min-width: 6em; padding-right: 1em;"/> { diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index a7e9bbad..ced48c6e 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -404,7 +404,7 @@ var Bookmarks = Module("bookmarks", { let frames = buffer.allFrames(); if (!args.bang) 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))]; context.keys.text = "title"; context.keys.description = "url"; @@ -464,7 +464,7 @@ var Bookmarks = Module("bookmarks", { context.title = ["Page URL"]; let frames = buffer.allFrames(); 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))]; return; } @@ -626,7 +626,7 @@ var Bookmarks = Module("bookmarks", { if (item && item.url.indexOf("%s") > -1) context.fork("keyword/" + keyword, keyword.length + space.length, null, function (context) { context.format = history.format; - context.title = [keyword + " Quick Search"]; + context.title = [/*L*/keyword + " Quick Search"]; // context.background = true; context.compare = CompletionContext.Sort.unsorted; context.generate = function () { @@ -671,7 +671,7 @@ var Bookmarks = Module("bookmarks", { return; 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.compare = CompletionContext.Sort.unsorted; ctxt.filterFunc = null; diff --git a/common/content/buffer.js b/common/content/buffer.js index 441473dd..dd42d7df 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -75,7 +75,7 @@ var Buffer = Module("buffer", { } if (!verbose && nFeed) - yield nFeed + " feed" + (nFeed > 1 ? "s" : ""); + yield nFeed + /*L*/" feed" + (nFeed > 1 ? "s" : ""); }); this.addPageInfoSection("g", "General Info", function (verbose) { @@ -110,7 +110,7 @@ var Buffer = Module("buffer", { if (!verbose) { if (pageSize[0]) - yield (pageSize[1] || pageSize[0]) + " bytes"; + yield (pageSize[1] || pageSize[0]) + /*L*/" bytes"; yield lastMod; return; } @@ -171,7 +171,7 @@ var Buffer = Module("buffer", { if (identity._overrideService.hasMatchingOverride(identity._lastLocation.hostname, (identity._lastLocation.port || 443), data.cert, {}, {})) - yield ["User exception", "true"] + yield ["User exception", /*L*/"true"] break; } }); @@ -607,7 +607,7 @@ var Buffer = Module("buffer", { try { window.urlSecurityCheck(uri.spec, doc.nodePrincipal); - io.CommandFileMode("Save link: ", { + io.CommandFileMode(/*L*/"Save link: ", { onSubmit: function (path) { let file = io.File(path); if (file.exists() && file.isDirectory()) @@ -831,7 +831,7 @@ var Buffer = Module("buffer", { * @param {Node} elem The element to query. */ 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)), scrollPages: deprecated("buffer.scrollHorizontal", function scrollPages(pages) buffer.scrollVertical("pages", pages)), 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") .localize("title"), @@ -1125,13 +1125,13 @@ var Buffer = Module("buffer", { var names = []; if (node.title) - names.push([node.title, "Page Name"]); + names.push([node.title, /*L*/"Page Name"]); if (node.alt) - names.push([node.alt, "Alternate Text"]); + names.push([node.alt, /*L*/"Alternate Text"]); 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"]); @@ -1534,7 +1534,7 @@ var Buffer = Module("buffer", { i = i + 1; return { - text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url], + text: [i + ": " + (tab.label || /*L*/"(Untitled)"), i + ": " + url], tab: tab, id: i - 1, url: url, diff --git a/common/content/commandline.js b/common/content/commandline.js index ab82fb36..611e2669 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -313,7 +313,7 @@ var CommandMode = Class("CommandMode", { open: function (command) { 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; modes.push(this.mode, this.extendedMode, this.closure); @@ -431,7 +431,7 @@ var CommandExMode = Class("CommandExMode", CommandMode, { }, onSubmit: function onSubmit(command) { - contexts.withContext({ file: "[Command Line]", line: 1 }, + contexts.withContext({ file: /*L*/"[Command Line]", line: 1 }, function _onSubmit() { io.withSavedValues(["readHeredoc"], function _onSubmit() { this.readHeredoc = commandline.readHeredoc; @@ -1627,7 +1627,7 @@ var ItemList = Class("ItemList", { _init: function _init() { this._div = this._dom( <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 highlight="Completions"> { diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 35e8e588..f5824435 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -197,7 +197,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { argCount: "*", completer: function (context, args) { 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 = {}; context.completions = array(item.description.toLowerCase().split(/[()\s]+/) for (item in params.iterate(args))) @@ -685,7 +685,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { unescape(encodeURI( // UTF-8 handling hack. <document xmlns={NS} name="plugins" title={config.appName + " Plugins"}> - <h1 tag="using-plugins">Using Plugins</h1> + <h1 tag="using-plugins"><!--L-->Using Plugins</h1> <toc start="2"/> {body} @@ -1010,7 +1010,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { <description>{ obj.description ? br + <p>{template.linkifyHelp(obj.description.replace(/\.?$/, "."), true)}</p> : "" }{ 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> </item></>; @@ -1073,7 +1073,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { * These are set and accessed with the "g:" prefix. */ _globalVariables: {}, - globalVariables: deprecated("the options system", { + globalVariables: deprecated(/*L*/"the options system", { get: function globalVariables() this._globalVariables }), @@ -1160,7 +1160,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { onExecute: function onExecute(event) { let cmd = event.originalTarget.getAttribute("dactyl-execute"); 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( <table> <tr highlight="Title" align="left"> - <th colspan="3">Code execution summary</th> + <th colspan="3"><!--L-->Code execution summary</th> </tr> <tr><td>  Executed:</td><td align="right"><span class="times-executed">{count}</span></td><td>times</td></tr> <tr><td>  Average time:</td><td align="right"><span class="time-average">{each.toFixed(2)}</span></td><td>{eachUnits}</td></tr> diff --git a/common/content/editor.js b/common/content/editor.js index 6e9069ef..6f4e8836 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -321,7 +321,7 @@ var Editor = Module("editor", { try { var tmpfile = io.createTempFile(); if (!tmpfile) - throw Error("Couldn't create temporary file"); + throw Error(/*L*/"Couldn't create temporary file"); if (textBox) { highlight.highlightNode(textBox, origGroup + " EditorEditing"); @@ -329,7 +329,7 @@ var Editor = Module("editor", { } 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"); var lastUpdate = Date.now(); diff --git a/common/content/help.xsl b/common/content/help.xsl index 3dcdf215..8514f92e 100644 --- a/common/content/help.xsl +++ b/common/content/help.xsl @@ -185,7 +185,7 @@ <xsl:if test="//dactyl:toc[1 and self::*]"> <div dactyl:highlight="HelpTOC"> - <h2>Contents</h2> + <h2><!--L-->Contents</h2> <xsl:if test="@start"> <xsl:call-template name="toc"> <xsl:with-param name="level" select="number(@start)"/> @@ -240,7 +240,7 @@ </xsl:when> <xsl:when test="contains($type, 'list') or contains($type, 'map')"> <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:otherwise> <span> @@ -430,7 +430,7 @@ <xsl:template match="dactyl:deprecated" mode="help-2"> <p style="clear: both;"> <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:apply-templates select="node()" mode="help-1"/> </p> @@ -439,7 +439,7 @@ <p style="clear: both;"> <xsl:apply-templates select="@*" mode="help-1"/> <div style="clear: both;"/> - <span dactyl:highlight="HelpNote">Note:</span> + <span dactyl:highlight="HelpNote"><!--L-->Note:</span> <xsl:text> </xsl:text> <xsl:apply-templates select="node()" mode="help-1"/> </p> @@ -448,7 +448,7 @@ <p style="clear: both;"> <xsl:apply-templates select="@*" mode="help-1"/> <div style="clear: both;"/> - <span dactyl:highlight="HelpWarning">Warning:</span> + <span dactyl:highlight="HelpWarning"><!--L-->Warning:</span> <xsl:text> </xsl:text> <xsl:apply-templates select="node()" mode="help-1"/> </p> diff --git a/common/content/history.js b/common/content/history.js index cf985d99..0d34acc7 100644 --- a/common/content/history.js +++ b/common/content/history.js @@ -219,7 +219,7 @@ var History = Module("history", { description: "The sort order of the results", completer: function (context, args) { context.compare = CompletionContext.Sort.unsorted; - return array.flatten([ + return /*L*/array.flatten([ "annotation", "date", "date added", diff --git a/common/content/mappings.js b/common/content/mappings.js index 99b6e9af..e7badaa8 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -168,7 +168,7 @@ var MapHive = Class("MapHive", Contexts.Hive, { modes = Array.concat(modes); if (!modes.every(util.identity)) - throw TypeError("Invalid modes: " + modes); + throw TypeError(/*L*/"Invalid modes: " + modes); let map = Map(modes, keys, description, action, extra); map.definedAt = contexts.getCaller(Components.stack.caller); @@ -431,9 +431,9 @@ var Mappings = Module("mappings", { let list = <table> <tr highlight="Title"> <td/> - <td style="padding-right: 1em;">Mode</td> - <td style="padding-right: 1em;">Command</td> - <td style="padding-right: 1em;">Action</td> + <td style="padding-right: 1em;"><!--L-->Mode</td> + <td style="padding-right: 1em;"><!--L-->Command</td> + <td style="padding-right: 1em;"><!--L-->Action</td> </tr> <col style="min-width: 6em; padding-right: 1em;"/> { @@ -531,7 +531,7 @@ var Mappings = Module("mappings", { { names: ["-description", "-desc", "-d"], description: "A description of this mapping", - default: "User-defined mapping", + default: /*L*/"User-defined mapping", type: CommandOption.STRING }, { diff --git a/common/content/mow.js b/common/content/mow.js index d0afda6f..51e55076 100644 --- a/common/content/mow.js +++ b/common/content/mow.js @@ -53,16 +53,16 @@ var MOW = Module("mow", { <popupset> <menupopup id="dactyl-contextmenu" highlight="Events" events="contextEvents"> <menuitem id="dactyl-context-copylink" - label="Copy Link Location" dactyl:group="link" + label={/*L*/"Copy Link Location"} dactyl:group="link" oncommand="goDoCommand('cmd_copyLink');"/> <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'));"/> <menuitem id="dactyl-context-copy" - label="Copy" dactyl:group="selection" + label={/*L*/"Copy"} dactyl:group="selection" command="cmd_copy"/> <menuitem id="dactyl-context-selectall" - label="Select All" + label={/*L*/"Select All"} command="cmd_selectAll"/> </menupopup> </popupset> diff --git a/common/content/quickmarks.js b/common/content/quickmarks.js index c12e7681..0e73b4f3 100644 --- a/common/content/quickmarks.js +++ b/common/content/quickmarks.js @@ -157,7 +157,7 @@ var QuickMarks = Module("quickmarks", { context.fork("current", 0, this, function (context) { context.title = ["Extra Completions"]; context.completions = [ - [quickmarks.get(args[0]), "Current Value"] + [quickmarks.get(args[0]), _("option.currentValue")] ].filter(function ([k, v]) k); }); context.fork("url", 0, completion, "url"); diff --git a/common/content/statusline.js b/common/content/statusline.js index b36b238f..3a5f3d2e 100644 --- a/common/content/statusline.js +++ b/common/content/statusline.js @@ -308,7 +308,7 @@ var StatusLine = Module("statusline", { else if (typeof progress == "number") { let progressStr = ""; if (this._progress <= 0) - progressStr = "[ Loading... ]"; + progressStr = /*L*/"[ Loading... ]"; else if (this._progress < 1) { let progress = Math.round(this._progress * 20); progressStr = "[" diff --git a/common/modules/addons.jsm b/common/modules/addons.jsm index 290c8ebd..2d584911 100644 --- a/common/modules/addons.jsm +++ b/common/modules/addons.jsm @@ -282,11 +282,11 @@ var AddonList = Class("AddonList", { XML.ignoreWhitespace = true; util.xmlToDom(<table highlight="Addons" key="list" xmlns={XHTML}> <tr highlight="AddonHead"> - <td>Name</td> - <td>Version</td> - <td>Status</td> + <td><!--L-->Name</td> + <td><!--L-->Version</td> + <td><!--L-->Status</td> <td/> - <td>Description</td> + <td><!--L-->Description</td> </tr> </table>, this.document, this.nodes); diff --git a/common/modules/commands.jsm b/common/modules/commands.jsm index 31420fe9..7f40a961 100644 --- a/common/modules/commands.jsm +++ b/common/modules/commands.jsm @@ -657,11 +657,11 @@ var Commands = Module("commands", { <tr highlight="Title"> <td/> <td style="padding-right: 1em;"></td> - <td style="padding-right: 1ex;">Name</td> - <td style="padding-right: 1ex;">Args</td> - <td style="padding-right: 1ex;">Range</td> - <td style="padding-right: 1ex;">Complete</td> - <td style="padding-right: 1ex;">Definition</td> + <td style="padding-right: 1ex;"><!--L-->Name</td> + <td style="padding-right: 1ex;"><!--L-->Args</td> + <td style="padding-right: 1ex;"><!--L-->Range</td> + <td style="padding-right: 1ex;"><!--L-->Complete</td> + <td style="padding-right: 1ex;"><!--L-->Definition</td> </tr> <col style="min-width: 6em; padding-right: 1em;"/> { diff --git a/common/modules/completion.jsm b/common/modules/completion.jsm index 74e8cf15..2e29c638 100644 --- a/common/modules/completion.jsm +++ b/common/modules/completion.jsm @@ -960,7 +960,7 @@ var Completion = Module("completion", { context.title = ["URL", "Title"]; context.fork("additional", 0, this, function (context) { - context.title[0] += " (additional)"; + context.title[0] += /*L*/" (additional)"; context.filter = context.parent.filter; // FIXME context.completions = context.parent.completions; // For items whose URL doesn't exactly match the filter, diff --git a/common/modules/config.jsm b/common/modules/config.jsm index 310545e6..cb18251f 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -159,7 +159,7 @@ var ConfigBase = Class("ConfigBase", { "--template=hg{rev}-" + this.branch + " ({date|isodate})"]).output; let version = this.addon.version; if ("@DATE@" !== "@" + "DATE@") - version += " (created: @DATE@)"; + version += /*L*/" (created: @DATE@)"; return version; }), @@ -624,7 +624,7 @@ var ConfigBase = Class("ConfigBase", { HelpEx;;;FontCode display: inline-block; color: #527BBD; 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; HelpInfoLabel display: inline-block; width: 6em; color: magenta; font-weight: bold; vertical-align: text-top; diff --git a/common/modules/downloads.jsm b/common/modules/downloads.jsm index 39441259..b4d8e070 100644 --- a/common/modules/downloads.jsm +++ b/common/modules/downloads.jsm @@ -137,7 +137,7 @@ var Download = Class("Download", { if (this.timeRemaining) this.nodes.time.textContent = util.formatSeconds(this.timeRemaining); 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 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}> <tr highlight="DownloadHead"> - <span>Title</span> - <span>Status</span> + <span><!--L-->Title</span> + <span><!--L-->Status</span> <span/> - <span>Progress</span> + <span><!--L-->Progress</span> <span/> - <span>Time remaining</span> - <span>Source</span> + <span><!--L-->Time remaining</span> + <span><!--L-->Source</span> </tr> <tr highlight="Download"><span><div style="min-height: 1ex; /* FIXME */"/></span></tr> <tr highlight="Download" key="totals" active="true"> - <td><span highlight="Title">Totals:</span> <span key="total"/></td> + <td><span highlight="Title"><!--L-->Totals:</span> <span key="total"/></td> <td/> <td highlight="DownloadButtons"> - <a highlight="Button" key="clear">Clear</a> + <a highlight="Button" key="clear"><!--L-->Clear</a> </td> <td highlight="DownloadProgress" key="progress"> <span highlight="DownloadProgressHave" key="progressHave" @@ -277,7 +277,7 @@ var DownloadList = Class("DownloadList", let active = downloads.filter(function (dl) dl.alive).length; if (active) - this.nodes.total.textContent = active + " active"; + this.nodes.total.textContent = /*L*/active + " active"; else for (let key in values(["total", "percent", "time"])) this.nodes[key].textContent = ""; }, diff --git a/common/modules/highlight.jsm b/common/modules/highlight.jsm index 128c26a1..37d769d5 100644 --- a/common/modules/highlight.jsm +++ b/common/modules/highlight.jsm @@ -369,7 +369,10 @@ var Highlights = Module("Highlight", { else if (args.completeArg == 1) { let hl = highlight.get(args[0]); 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"); } }, diff --git a/common/modules/io.jsm b/common/modules/io.jsm index 57a32857..edf378d0 100644 --- a/common/modules/io.jsm +++ b/common/modules/io.jsm @@ -208,7 +208,7 @@ var IO = Module("io", { } catch (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) dactyl.echoerr(message); } @@ -831,7 +831,7 @@ unlet s:cpo_save let result = io.system(arg); if (result.returnValue != 0) - result.output += "\nshell returned " + result.returnValue; + result.output += /*L*/"\nshell returned " + result.returnValue; modules.commandline.command = "!" + arg; modules.commandline.commandOutput(<span highlight="CmdOutput">{result.output}</span>); @@ -981,9 +981,9 @@ unlet s:cpo_save context.key = match.prefix; context.advance(match.prefix.length + 1); context.generate = function () iter({ - content: "Chrome content", - locale: "Locale-specific content", - skin: "Theme-specific content" + content: /*L*/"Chrome content", + locale: /*L*/"Locale-specific content", + skin: /*L*/"Theme-specific content" }); } } diff --git a/common/modules/javascript.jsm b/common/modules/javascript.jsm index 49feed58..981ec418 100644 --- a/common/modules/javascript.jsm +++ b/common/modules/javascript.jsm @@ -45,7 +45,7 @@ var JavaScript = Module("javascript", { }), globals: Class.memoize(function () [ - [this.modules.userContext, "Global Variables"], + [this.modules.userContext, /*L*/"Global Variables"], [this.modules, "modules"], [this.window, "window"] ]), @@ -120,9 +120,9 @@ var JavaScript = Module("javascript", { context[JavaScript.EVAL_EXPORT] = function export_(obj) cache[key] = obj; try { 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 - 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]; } @@ -170,7 +170,7 @@ var JavaScript = Module("javascript", { if (this._top.char != arg) { 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 @@ -308,7 +308,7 @@ var JavaScript = Module("javascript", { if (this._checkFunction(prev, dot, cacheKey)) return []; 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 []; } @@ -324,7 +324,7 @@ var JavaScript = Module("javascript", { let end = (frame == -1 ? this._lastIdx : this._get(frame + 1).offset); 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? if (dot < statement) // No. dot = statement - 1; @@ -339,7 +339,7 @@ var JavaScript = Module("javascript", { const self = this; 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); base.forceAnchored = true; @@ -419,14 +419,14 @@ var JavaScript = Module("javascript", { objects.forEach(function (obj) { obj.ctxt_p.split(obj[1] + "/anchored", this, function (context) { context.anchored = true; - context.title[0] += " (prototypes)"; + context.title[0] += /*L*/" (prototypes)"; }); }); objects.forEach(function (obj) { obj.ctxt_t.split(obj[1] + "/unanchored", this, function (context) { context.anchored = false; - context.title[0] += " (substrings)"; + context.title[0] += /*L*/" (substrings)"; context.filters.push(unanchored); }); }); @@ -434,7 +434,7 @@ var JavaScript = Module("javascript", { objects.forEach(function (obj) { obj.ctxt_p.split(obj[1] + "/unanchored", this, function (context) { context.anchored = false; - context.title[0] += " (prototype substrings)"; + context.title[0] += /*L*/" (prototype substrings)"; context.filters.push(unanchored); }); }); @@ -775,8 +775,8 @@ var JavaScript = Module("javascript", { this.js.newContext = function newContext() modules.newContext(self.context, !sandbox); this.js.globals = [ - [this.context, "REPL Variables"], - [context, "REPL Global"] + [this.context, /*L*/"REPL Variables"], + [context, /*L*/"REPL Global"] ].concat(this.js.globals.filter(function ([global]) isPrototypeOf.call(global, context))); if (!isPrototypeOf.call(modules.jsmodules, context)) diff --git a/common/modules/prefs.jsm b/common/modules/prefs.jsm index e9b85bbb..6837f735 100644 --- a/common/modules/prefs.jsm +++ b/common/modules/prefs.jsm @@ -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) util.assert(type === Ci.nsIPrefBranch.PREF_INVALID || type === needType, type === Ci.nsIPrefBranch.PREF_INT - ? "E521: Number required after =: " + name + "=" + value - : "E474: Invalid argument: " + name + "=" + value); + ? /*L*/"E521: Number required after =: " + name + "=" + value + : /*L*/"E474: Invalid argument: " + name + "=" + value); let type = this.branch.getPrefType(name); switch (typeof value) { diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm index 27880c13..837a9a6b 100644 --- a/common/modules/sanitizer.jsm +++ b/common/modules/sanitizer.jsm @@ -183,7 +183,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef append: { SanitizeDialogPane: <groupbox orient="horizontal" xmlns={XUL}> - <caption label={config.appName + " (see :help privacy)"}/> + <caption label={config.appName + /*L*/" (see :help privacy)"}/> <grid flex="1"> <columns><column flex="1"/><column flex="1"/></columns> <rows>{ @@ -204,7 +204,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef function (win) prefOverlay(branch, false, { append: { 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]) <listitem xmlns={XUL} type="checkbox" @@ -343,16 +343,18 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef deny: 2, session: 8 }, + UNPERMS: Class.memoize(function () iter(this.PERMS).map(Array.reverse).toObject()), + COMMANDS: { - unset: "Unset", - allow: "Allowed", - deny: "Denied", - session: "Allowed for the current session", - list: "List all cookies for domain", - clear: "Clear all cookies for domain", - "clear-persistent": "Clear all persistent cookies for domain", - "clear-session": "Clear all session cookies for domain" + unset: /*L*/"Unset", + allow: /*L*/"Allowed", + deny: /*L*/"Denied", + session: /*L*/"Allowed for the current session", + list: /*L*/"List all cookies for domain", + clear: /*L*/"Clear all cookies for domain", + "clear-persistent": /*L*/"Clear all persistent cookies for domain", + "clear-session": /*L*/"Clear all session cookies for domain" }, argPrefMap: { diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm index 67500700..1bdf235b 100644 --- a/common/modules/storage.jsm +++ b/common/modules/storage.jsm @@ -321,9 +321,9 @@ var File = Class("File", { */ iterDirectory: function () { if (!this.exists()) - throw Error("File does not exist"); + throw Error(/*L*/"File does not exist"); if (!this.isDirectory()) - throw Error("Not a directory"); + throw Error(/*L*/"Not a directory"); for (let file in iter(this.directoryEntries)) yield File(file); }, @@ -362,7 +362,7 @@ var File = Class("File", { */ readDirectory: function (sort) { if (!this.isDirectory()) - throw Error("Not a directory"); + throw Error(/*L*/"Not a directory"); let array = [e for (e in this.iterDirectory())]; if (sort) @@ -515,7 +515,7 @@ var File = Class("File", { DoesNotExist: function (path, error) ({ path: path, exists: function () false, - __noSuchMethod__: function () { throw error || Error("Does not exist"); } + __noSuchMethod__: function () { throw error || Error(/*L*/"Does not exist"); } }), defaultEncoding: "UTF-8", diff --git a/common/modules/styles.jsm b/common/modules/styles.jsm index 027373f4..d267565f 100644 --- a/common/modules/styles.jsm +++ b/common/modules/styles.jsm @@ -312,9 +312,9 @@ var Styles = Module("Styles", { <tr highlight="Title"> <td/> <td/> - <td style="padding-right: 1em;">Name</td> - <td style="padding-right: 1em;">Filter</td> - <td style="padding-right: 1em;">CSS</td> + <td style="padding-right: 1em;"><!--L-->Name</td> + <td style="padding-right: 1em;"><!--L-->Filter</td> + <td style="padding-right: 1em;"><!--L-->CSS</td> </tr> <col style="min-width: 4em; padding-right: 1em;"/> <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.title = ["Current Site"]; context.completions = [ - [content.location.host, "Current Host"], - [content.location.href, "Current URL"] + [content.location.host, /*L*/"Current Host"], + [content.location.href, /*L*/"Current URL"] ]; }); } @@ -389,7 +389,7 @@ var Styles = Module("Styles", { context.generate = function () values(group.sites); 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(", "); 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)); @@ -434,7 +434,7 @@ var Styles = Module("Styles", { for (let item in Iterator({ Active: true, Inactive: false })) { let [name, active] = item; 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); }); } @@ -584,7 +584,9 @@ var Styles = Module("Styles", { } else if (args.completeArg == 1) { if (sheet) - context.completions = [[sheet.css, "Current Value"]]; + context.completions = [ + [sheet.css, _("option.currentValue")] + ]; context.fork("css", 0, modules.completion, "css"); } }, diff --git a/common/modules/template.jsm b/common/modules/template.jsm index 8a398c2e..b979e709 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -363,7 +363,9 @@ var Template = Module("Template", { // <e4x> return <table> <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> { 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) !frame ? name : 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> </td> { item.columns ? template.map(item.columns, function (c) <td>{c}</td>) : "" } diff --git a/common/modules/util.jsm b/common/modules/util.jsm index 09fedccf..989f6ef1 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -309,7 +309,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), } else if (char === "]") { stack.pop(); - util.assert(stack.length, "Unmatched %] in format"); + util.assert(stack.length, /*L*/"Unmatched %] in format"); } else { 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) 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; }, @@ -375,7 +375,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), } else if (close) { stack.pop(); - util.assert(stack.length, "Unmatched %] in macro"); + util.assert(stack.length, /*L*/"Unmatched %] in macro"); } else { let [, flags, name] = /^((?:[a-z]-)*)(.*)/.exec(macro); @@ -402,7 +402,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), if (end < macro.length) 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; }, @@ -759,12 +759,12 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), [hours, minutes] = div(minutes, 60); [days, hours] = div(hours, 24); if (days) - return days + " days " + hours + " hours" + return /*L*/days + " days " + hours + " hours" if (hours) - return hours + "h " + minutes + "m"; + return /*L*/hours + "h " + minutes + "m"; if (minutes) - return minutes + ":" + pad(2, seconds); - return seconds + "s"; + return /*L*/minutes + ":" + pad(2, seconds); + return /*L*/seconds + "s"; }, /** |