diff --git a/common/content/buffer.js b/common/content/buffer.js index 99b06b1b..877e30c0 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1140,6 +1140,9 @@ var Buffer = Module("buffer", { }, scrollTo: function scrollTo(elem, left, top) { + // Temporary hack. Should be done better. + if (elem.ownerDocument == buffer.focusedFrame.document) + marks.add("'"); if (left != null) elem.scrollLeft = left; if (top != null) diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 141c30e7..b8548735 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -595,8 +595,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { let info = context.INFO; if (info.*.@lang.length()) { let langs = set(String(a) for each (a in info.*.@lang)); - let lang = [window.navigator.language, - window.navigator.language.replace(/-.*/, ""), + let lang = [config.language, config.language.replace(/-.*/, ""), "en", "en-US", info.*.@lang[0] ].filter(function (l) set.has(langs, l))[0]; diff --git a/common/content/marks.js b/common/content/marks.js index a0762960..beb04eac 100644 --- a/common/content/marks.js +++ b/common/content/marks.js @@ -201,7 +201,7 @@ var Marks = Module("marks", { (tab ? ", tab: " + tabs.index(tab) : ""); }, - isLocalMark: function isLocalMark(mark) /^[a-z]$/.test(mark), + isLocalMark: function isLocalMark(mark) /^[a-z`']$/.test(mark), isURLMark: function isURLMark(mark) /^[A-Z]$/.test(mark) }, { diff --git a/common/modules/config.jsm b/common/modules/config.jsm index 309e7bea..91c36dfc 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -55,6 +55,8 @@ var ConfigBase = Class("ConfigBase", { return addon; }), + language: Class.memoize(function () services.chromeRegistry.getSelectedLocale("dactyl")), + /** @property {string} The Dactyl version string. */ version: Class.memoize(function () { if (/pre$/.test(this.addon.version)) { diff --git a/common/modules/services.jsm b/common/modules/services.jsm index 7bec5e5f..5e461ed5 100644 --- a/common/modules/services.jsm +++ b/common/modules/services.jsm @@ -29,6 +29,7 @@ var Services = Module("Services", { this.add("browserSearch", "@mozilla.org/browser/search-service;1", Ci.nsIBrowserSearchService); this.add("cache", "@mozilla.org/network/cache-service;1", Ci.nsICacheService); this.add("charset", "@mozilla.org/charset-converter-manager;1", Ci.nsICharsetConverterManager); + this.add("chromeRegistry", "@mozilla.org/chrome/chrome-registry;1", Ci.nsIXULChromeRegistry); this.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=dactyl"); this.add("console", "@mozilla.org/consoleservice;1", Ci.nsIConsoleService); this.add("dactyl:", "@mozilla.org/network/protocol;1?name=dactyl");