1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 23:52:26 +01:00

More polyglotization.

This commit is contained in:
Kris Maglione
2011-04-29 14:28:02 -04:00
parent c2acfadc85
commit 7115948106
18 changed files with 96 additions and 60 deletions

View File

@@ -203,9 +203,9 @@ var Abbreviations = Module("abbreviations", {
let list = <table>
<tr highlight="Title">
<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>
<td style="padding-right: 1em;">{_("title.Mode")}</td>
<td style="padding-right: 1em;">{_("title.Abbrev")}</td>
<td style="padding-right: 1em;">{_("title.Replacement")}</td>
</tr>
<col style="min-width: 6em; padding-right: 1em;"/>
{

View File

@@ -1629,7 +1629,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"><!--L-->No Completions</span></div>
<div highlight="Completions" key="noCompletions"><span highlight="Title">{_("completion.noCompletions")}</span></div>
<div key="completions"/>
<div highlight="Completions">
{

View File

@@ -689,7 +689,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"><!--L-->Using Plugins</h1>
<h1 tag="using-plugins">{_("help.title.Using Plugins")}</h1>
<toc start="2"/>
{body}
@@ -1078,7 +1078,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
* These are set and accessed with the "g:" prefix.
*/
_globalVariables: {},
globalVariables: deprecated(/*L*/"the options system", {
globalVariables: deprecated(_("deprecated.for.theOptionsSystem"), {
get: function globalVariables() this._globalVariables
}),
@@ -1967,11 +1967,11 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
commandline.commandOutput(
<table>
<tr highlight="Title" align="left">
<th colspan="3"><!--L-->Code execution summary</th>
<th colspan="3">{_("title.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>
<tr><td>&#xa0;&#xa0;Total time:</td><td align="right"><span class="time-total">{total.toFixed(2)}</span></td><td>{totalUnits}</td></tr>
<tr><td>&#xa0;&#xa0;{_("title.Executed")}:</td><td align="right"><span class="times-executed">{count}</span></td><td><!--L-->times</td></tr>
<tr><td>&#xa0;&#xa0;{_("title.Average time")}:</td><td align="right"><span class="time-average">{each.toFixed(2)}</span></td><td>{eachUnits}</td></tr>
<tr><td>&#xa0;&#xa0;{_("title.Total time")}:</td><td align="right"><span class="time-total">{total.toFixed(2)}</span></td><td>{totalUnits}</td></tr>
</table>);
}
else {

View File

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

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 /*L*/array.flatten([
return array.flatten([
"annotation",
"date",
"date added",
@@ -230,8 +230,8 @@ var History = Module("history", {
"uri",
"visitcount"
].map(function (order) [
["+" + order.replace(" ", ""), "Sort by " + order + " ascending"],
["-" + order.replace(" ", ""), "Sort by " + order + " descending"]
["+" + order.replace(" ", ""), /*L*/"Sort by " + order + " ascending"],
["-" + order.replace(" ", ""), /*L*/"Sort by " + order + " descending"]
]));
}
}

View File

@@ -431,9 +431,9 @@ var Mappings = Module("mappings", {
let list = <table>
<tr highlight="Title">
<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>
<td style="padding-right: 1em;">{_("title.Mode")}</td>
<td style="padding-right: 1em;">{_("title.Command")}</td>
<td style="padding-right: 1em;">{_("title.Action")}</td>
</tr>
<col style="min-width: 6em; padding-right: 1em;"/>
{

View File

@@ -100,11 +100,14 @@ command.set.unknownOption-1 = E518: Unknown option: %S
command.yank.yankedLine-1 = Yanked %S line
command.yank.yankedLines-1 = Yanked %S lines
completion.additional = (additional)
completion.generating = Generating results...
completion.noCompletions = No Completions
completion.waitingFor-1 = Waiting for %S
completion.waitingForKeyPress = Waiting for key press
completion.matchIndex-2 = match %S of %S
completion.generating = Generating results...
dactyl.created-1 = "(created %S)"
dactyl.parsingCommandLine-1 = Parsing command line options: %S
dactyl.notCommand-2 = E492: Not a %S command: %S
dactyl.sourcingPlugins-1 = Sourcing plugin directory: %S...
@@ -117,6 +120,8 @@ dactyl.sourced-1 = Sourced: %S
dactyl.prompt.openMany-1 = This will open %S new tabs. Would you like to continue? (yes/[no]):
dactyl.yank-1 = Yank %S
deprecated.for.theOptionsSystem = the options system
dialog.notAvailable-1 = Dialog %S not available
# TODO: merge with addon.*?
@@ -155,8 +160,10 @@ group.invalidName-1 = Invalid group name: %S
group.noCurrent = No current group
help.dontPanic = E478: Don't panic!
help.Example = Example
help.noFile-1 = Sorry, help file %S not found
help.noTopic-1 = Sorry, no help for %S
help.title.Using Plugins = Using Plugins
hints.noMatcher-1 = Invalid 'hintmatching' type: %S
@@ -164,23 +171,29 @@ history.noMatching-1 = No history matching %S
history.none = No history set
history.noURL = URL not found in history
io.noSuchDir-1 = E344: Can't find directory %S
io.noPrevDir = E186: No previous directory
io.notReadable-1 = Can't open file %S
io.notWriteable-1 = Can't open file %S for writing
io.callingShell-1 = Calling shell to execute: %S
io.cantCreateTempFile = Couldn't create temporary file
io.cantEncode = Input contains characters not valid in the current file encoding
io.commandFailed = E472: Command failed
io.definedAt = Defined at %S
io.downloadFinished-2 = Download of %S to %S finished
io.eNotDir = Not a directory
io.exists = File exists (add ! to override)
io.exists-1 = File %S exists (add ! to override)
io.noCommand-1 = Command not found: %S
io.commandFailed = E472: Command failed
io.oneFileAllowed = E172: Only one file name allowed
io.callingShell-1 = Calling shell to execute: %S
io.sourcing-1 = sourcing %S
io.sourcingEnd-1 = finished sourcing %S
io.noPrevDir = E186: No previous directory
io.noSuchDir-1 = E344: Can't find directory %S
io.noSuchFile = File does not exist
io.notInRTP-1 = not found in 'runtimepath': %S
io.notReadable-1 = Can't open file %S
io.notWriteable-1 = Can't open file %S for writing
io.oneFileAllowed = E172: Only one file name allowed
io.searchingFor-1 = Searching for %S
io.searchingFor-2 = Searching for %S in %S
io.downloadFinished-2 = Download of %S to %S finished
io.shellReturn-1 = shell returned %S
io.sourcing-1 = sourcing %S
io.sourcingEnd-1 = finished sourcing %S
io.sourcingError-1 = Sourcing file: %S
macro.canceled-1 = Canceled playback of macro '%S'
macro.recorded-1 = Recorded macro '%S'
@@ -246,6 +259,7 @@ plugin.searchingFor-1 = Searching for %S
plugin.searchingForIn-2 = Searching for %S in %S
plugin.notReplacingContext-1 = Not replacing plugin context for %S
pref.hostPreferences-1 = %S Preferences
pref.prompt.resetAll-1 = Warning: Resetting all preferences may make %S unusable. Would you like to continue (yes/[no]):
pref.safeSet.warnChanged-1 = Warning: Setting preference %S, but it's changed from its default value.
@@ -273,13 +287,33 @@ style.inline = inline
time.total-1 = Total time: %S
title.Abbrev = Abbrev
title.Action = Action
title.Args = Args
title.Average time = Average time
title.CSS = CSS
title.Code execution summary = Code execution summary
title.Command = Command
title.Complete = Complete
title.Definition = Definition
title.Description = Description
title.Executed = Executed
title.Filter = Filter
title.Jump = Jump
title.Mode = Mode
title.Name = Name
title.Progress = Progress
title.Range = Range
title.Replacement = Replacement
title.Source = Source
title.Speed = Speed
title.Status = Status
title.Time remaining = Time remaining
title.Title = Title
title.Total time = Total time
title.Totals = Totals
title.URI = URI
title.Version = Version
variable.none = No variables found

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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);
/**

View File

@@ -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));
},
/**

View File

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

View File

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

View File

@@ -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>) : "" }