mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 00:47:59 +01:00
Allow fallback to en-US for missing files in the selected locale.
This commit is contained in:
@@ -190,9 +190,9 @@ Dactyl.prototype = {
|
||||
return redirect("dactyl://help/" + this.HELP_TAGS[tag] + "#" + tag.replace(/#/g, encodeURIComponent), uri);
|
||||
break;
|
||||
case "locale":
|
||||
return makeChannel(["resource://dactyl-locale", config.locale, path].join("/"), uri);
|
||||
return LocaleChannel("dactyl-locale", path, uri);
|
||||
case "locale-local":
|
||||
return makeChannel(["resource://dactyl-local-locale", config.locale, path].join("/"), uri);
|
||||
return LocaleChannel("dactyl-local-locale", path, uri);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
@@ -216,6 +216,15 @@ Dactyl.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
function LocaleChannel(base, path, orig) {
|
||||
for each (let locale in [config.locale, "en-US"]) {
|
||||
var channel = makeChannel(["resource:/", base, config.locale, path].join("/"), orig);
|
||||
if (channel.name !== DNE)
|
||||
break;
|
||||
}
|
||||
return channel;
|
||||
}
|
||||
|
||||
function StringChannel(data, contentType, uri) {
|
||||
let channel = services.StreamChannel(uri);
|
||||
channel.contentStream = services.StringStream(data);
|
||||
|
||||
@@ -75,6 +75,7 @@ var JavaScript = Module("javascript", {
|
||||
let globals = values(toplevel && this.window === obj ? this.globalNames : []);
|
||||
|
||||
if (toplevel && isObject(obj) && "wrappedJSObject" in obj)
|
||||
if (!set.add(seen, "wrappedJSObject"))
|
||||
yield "wrappedJSObject";
|
||||
|
||||
for (let key in iter(globals, properties(obj, !toplevel, true)))
|
||||
|
||||
Reference in New Issue
Block a user