mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-05 03:45:49 +01:00
More polyglotization.
This commit is contained in:
@@ -282,11 +282,11 @@ var AddonList = Class("AddonList", {
|
||||
XML.ignoreWhitespace = true;
|
||||
util.xmlToDom(<table highlight="Addons" key="list" xmlns={XHTML}>
|
||||
<tr highlight="AddonHead">
|
||||
<td><!--L-->Name</td>
|
||||
<td><!--L-->Version</td>
|
||||
<td><!--L-->Status</td>
|
||||
<td>{_("title.Name")}</td>
|
||||
<td>{_("title.Version")}</td>
|
||||
<td>{_("title.Status")}</td>
|
||||
<td/>
|
||||
<td><!--L-->Description</td>
|
||||
<td>{_("title.Description")}</td>
|
||||
</tr>
|
||||
</table>, this.document, this.nodes);
|
||||
|
||||
|
||||
@@ -194,8 +194,10 @@ function require(obj, name, from) {
|
||||
if (arguments.length === 1)
|
||||
[obj, name] = [{}, obj];
|
||||
|
||||
let caller = Components.stack.caller;
|
||||
|
||||
if (!loaded[name])
|
||||
defineModule.loadLog.push((from || "require") + ": loading " + name + (obj.NAME ? " into " + obj.NAME : ""));
|
||||
defineModule.loadLog.push((from || "require") + ": loading " + name + " into " + (obj.NAME || caller.filename + ":" + caller.lineNumber));
|
||||
|
||||
JSMLoader.load(name + ".jsm", obj);
|
||||
return obj;
|
||||
|
||||
@@ -660,11 +660,11 @@ var Commands = Module("commands", {
|
||||
<tr highlight="Title">
|
||||
<td/>
|
||||
<td style="padding-right: 1em;"></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>
|
||||
<td style="padding-right: 1ex;">{_("title.Name")}</td>
|
||||
<td style="padding-right: 1ex;">{_("title.Args")}</td>
|
||||
<td style="padding-right: 1ex;">{_("title.Range")}</td>
|
||||
<td style="padding-right: 1ex;">{_("title.Complete")}</td>
|
||||
<td style="padding-right: 1ex;">{_("title.Definition")}</td>
|
||||
</tr>
|
||||
<col style="min-width: 6em; padding-right: 1em;"/>
|
||||
{
|
||||
|
||||
@@ -960,7 +960,7 @@ var Completion = Module("completion", {
|
||||
context.title = ["URL", "Title"];
|
||||
|
||||
context.fork("additional", 0, this, function (context) {
|
||||
context.title[0] += /*L*/" (additional)";
|
||||
context.title[0] += " " + _("completion.additional");
|
||||
context.filter = context.parent.filter; // FIXME
|
||||
context.completions = context.parent.completions;
|
||||
// For items whose URL doesn't exactly match the filter,
|
||||
|
||||
@@ -31,13 +31,14 @@ var ConfigBase = Class("ConfigBase", {
|
||||
});
|
||||
},
|
||||
|
||||
loadStyles: function loadStyles() {
|
||||
loadStyles: function loadStyles(force) {
|
||||
const { highlight } = require("highlight");
|
||||
const { _ } = require("messages");
|
||||
|
||||
highlight.styleableChrome = this.styleableChrome;
|
||||
|
||||
highlight.loadCSS(this.CSS);
|
||||
highlight.loadCSS(this.helpCSS);
|
||||
highlight.loadCSS(this.CSS.replace(/__MSG_(.*?)__/g, function (m0, m1) _(m1)));
|
||||
highlight.loadCSS(this.helpCSS.replace(/__MSG_(.*?)__/g, function (m0, m1) _(m1)));
|
||||
|
||||
if (!util.haveGecko("2b"))
|
||||
highlight.loadCSS(<![CDATA[
|
||||
@@ -181,7 +182,7 @@ var ConfigBase = Class("ConfigBase", {
|
||||
"--template=hg{rev}-" + this.branch + " ({date|isodate})"]).output;
|
||||
let version = this.addon.version;
|
||||
if ("@DATE@" !== "@" + "DATE@")
|
||||
version += /*L*/" (created: @DATE@)";
|
||||
version += " " + _("dactyl.created", "@DATE@");
|
||||
return version;
|
||||
}),
|
||||
|
||||
@@ -646,7 +647,7 @@ var ConfigBase = Class("ConfigBase", {
|
||||
HelpEx;;;FontCode display: inline-block; color: #527BBD;
|
||||
|
||||
HelpExample display: block; margin: 1em 0;
|
||||
HelpExample::before content: /*L*/"Example: "; font-weight: bold;
|
||||
HelpExample::before content: "__MSG_help.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;
|
||||
|
||||
@@ -208,7 +208,7 @@ var IO = Module("io", {
|
||||
}
|
||||
catch (e) {
|
||||
dactyl.reportError(e);
|
||||
let message = /*L*/"Sourcing file: " + (e.echoerr || file.path + ": " + e);
|
||||
let message = _("io.sourcingError", e.echoerr || file.path + ": " + e);
|
||||
if (!params.silent)
|
||||
dactyl.echoerr(message);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ try {
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("overlay", {
|
||||
exports: ["ModuleBase"],
|
||||
require: ["config", "services", "util"]
|
||||
require: ["config", "io", "services", "util"]
|
||||
}, this);
|
||||
|
||||
/**
|
||||
|
||||
@@ -115,7 +115,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
|
||||
}
|
||||
};
|
||||
|
||||
return template.options(/*L*/config.host + " Preferences", prefs.call(this));
|
||||
return template.options(_("pref.hostPreferences", config.host), prefs.call(this));
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -321,9 +321,9 @@ var File = Class("File", {
|
||||
*/
|
||||
iterDirectory: function () {
|
||||
if (!this.exists())
|
||||
throw Error(/*L*/"File does not exist");
|
||||
throw Error(_("io.noSuchFile"));
|
||||
if (!this.isDirectory())
|
||||
throw Error(/*L*/"Not a directory");
|
||||
throw Error(_("io.eNotDir"));
|
||||
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(/*L*/"Not a directory");
|
||||
throw Error(_("io.eNotDir"));
|
||||
|
||||
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(/*L*/"Does not exist"); }
|
||||
__noSuchMethod__: function () { throw error || Error("Does not exist"); }
|
||||
}),
|
||||
|
||||
defaultEncoding: "UTF-8",
|
||||
|
||||
@@ -312,9 +312,9 @@ var Styles = Module("Styles", {
|
||||
<tr highlight="Title">
|
||||
<td/>
|
||||
<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>
|
||||
<td style="padding-right: 1em;">{_("title.Name")}</td>
|
||||
<td style="padding-right: 1em;">{_("title.Filter")}</td>
|
||||
<td style="padding-right: 1em;">{_("title.CSS")}</td>
|
||||
</tr>
|
||||
<col style="min-width: 4em; padding-right: 1em;"/>
|
||||
<col style="min-width: 1em; text-align: center; color: red; font-weight: bold;"/>
|
||||
|
||||
@@ -363,9 +363,9 @@ var Template = Module("Template", {
|
||||
// <e4x>
|
||||
return <table>
|
||||
<tr style="text-align: left;" highlight="Title">
|
||||
<th colspan="2"><!--L-->Jump</th>
|
||||
<th><!--L-->Title</th>
|
||||
<th><!--L-->URI</th>
|
||||
<th colspan="2">{_("title.Jump")}</th>
|
||||
<th>{_("title.Title")}</th>
|
||||
<th>{_("title.URI")}</th>
|
||||
</tr>
|
||||
{
|
||||
this.map(Iterator(elems), function ([idx, val])
|
||||
@@ -496,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}><!--L-->Defined at {sourceLink(frame)}</span>
|
||||
<span highlight="LinkInfo" xmlns:dactyl={NS}>{_("io.definedAt", sourceLink(frame))}</span>
|
||||
}</span>
|
||||
</td>
|
||||
{ item.columns ? template.map(item.columns, function (c) <td>{c}</td>) : "" }
|
||||
|
||||
Reference in New Issue
Block a user