1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-20 19:15:48 +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>
<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;"/>
{

View File

@@ -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;

View File

@@ -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,

View File

@@ -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">
{

View File

@@ -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>&#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>

View File

@@ -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();

View File

@@ -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>

View File

@@ -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",

View File

@@ -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
},
{

View File

@@ -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>

View File

@@ -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");

View File

@@ -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 = "["