diff --git a/common/content/editor.js b/common/content/editor.js index 25b2de84..007679db 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -855,6 +855,21 @@ var Editor = Module("editor", { options.add(["insertmode", "im"], "Enter Insert mode rather than Text Edit mode when focusing text areas", "boolean", true); + + options.add(["spelllang", "spl"], + "The language used by the spell checker", + "string", config.locale, + { + initValue: function () {}, + getter: function getter() services.spell.dictionary || "", + setter: function setter(val) { services.spell.dictionary = val; }, + completer: function completer(context) { + let res = {}; + services.spell.getDictionaryList(res, {}); + context.completions = res.value; + context.keys = { text: util.identity, description: util.identity }; + } + }); } }); diff --git a/common/locale/en-US/options.xml b/common/locale/en-US/options.xml index 3aa6f5a9..fa66f6fb 100644 --- a/common/locale/en-US/options.xml +++ b/common/locale/en-US/options.xml @@ -1326,6 +1326,16 @@ + + 'spl' 'spelllang' + 'spelllang' + &option.spelllang.type; + &option.spelllang.default; + + The language used by the spell checker. + + + 'ss' 'sanitizeshutdown' 'sanitizeshutdown' 'ss' diff --git a/common/modules/options.jsm b/common/modules/options.jsm index a09fef25..20da4a61 100644 --- a/common/modules/options.jsm +++ b/common/modules/options.jsm @@ -57,6 +57,9 @@ var Option = Class("Option", { if (Set.has(this.modules.config.defaults, this.name)) defaultValue = this.modules.config.defaults[this.name]; + if (defaultValue == null && this.getter) + defaultValue = this.getter(); + if (defaultValue !== undefined) { if (this.type === "string") defaultValue = Commands.quote(defaultValue); diff --git a/common/modules/services.jsm b/common/modules/services.jsm index b3372ddf..707619f2 100644 --- a/common/modules/services.jsm +++ b/common/modules/services.jsm @@ -57,6 +57,7 @@ var Services = Module("Services", { this.add("runtime", "@mozilla.org/xre/runtime;1", ["nsIXULAppInfo", "nsIXULRuntime"]); this.add("rdf", "@mozilla.org/rdf/rdf-service;1", "nsIRDFService"); this.add("sessionStore", "@mozilla.org/browser/sessionstore;1", "nsISessionStore"); + this.add("spell", "@mozilla.org/spellchecker/engine;1", "mozISpellCheckingEngine"); this.add("stringBundle", "@mozilla.org/intl/stringbundle;1", "nsIStringBundleService"); this.add("stylesheet", "@mozilla.org/content/style-sheet-service;1", "nsIStyleSheetService"); this.add("subscriptLoader", "@mozilla.org/moz/jssubscript-loader;1", "mozIJSSubScriptLoader"); diff --git a/pentadactyl/NEWS b/pentadactyl/NEWS index 8615b541..2f3eeb25 100644 --- a/pentadactyl/NEWS +++ b/pentadactyl/NEWS @@ -201,6 +201,7 @@ - Added 'passunknown' option. [b7] - Changed 'urlseparator' default value to "|". [b3] - Added "passwords" and "venkman" dialogs to :dialog. [b2] + - Added 'spelllang' option. [b8] - Make 'showmode' a [stringlist] option. [b7] - Added 'wildanchor' option. [b2] • Added BookmarkChange, BookmarkRemove autocommands. [b2]
The language used by the spell checker.