diff --git a/chrome/content/zotero/dictionaryManager.xul b/chrome/content/zotero/dictionaryManager.xhtml similarity index 100% rename from chrome/content/zotero/dictionaryManager.xul rename to chrome/content/zotero/dictionaryManager.xhtml diff --git a/chrome/content/zotero/xpcom/dictionaries.js b/chrome/content/zotero/xpcom/dictionaries.js index 14f38edffc..74df1b3a89 100644 --- a/chrome/content/zotero/xpcom/dictionaries.js +++ b/chrome/content/zotero/xpcom/dictionaries.js @@ -180,7 +180,8 @@ Zotero.Dictionaries = new function () { let dicPath = manifest.dictionaries[locale]; let affPath = OS.Path.join(dictionary.dir, ...dicPath.split(/\//)).slice(0, -3) + 'aff'; Zotero.debug(`Removing ${locale} dictionary`); - _spellChecker.removeDictionary(locale, Zotero.File.pathToFile(affPath)); + let file = new FileUtils.File(affPath); + _spellChecker.removeDictionary(locale, Services.io.newFileURI(file)); } } catch (e) { @@ -247,9 +248,12 @@ Zotero.Dictionaries = new function () { } } if (!name && inlineSpellChecker) { - name = inlineSpellChecker.getDictionaryDisplayName(locale) + let names = Services.intl.getLocaleDisplayNames(undefined, [locale]); + if (names.length) { + name = names[0]; + } } - return name || name; + return name || locale; }; /** @@ -296,8 +300,8 @@ Zotero.Dictionaries = new function () { locales.push(locale); let dicPath = manifest.dictionaries[locale]; let affPath = OS.Path.join(dir, ...dicPath.split(/\//)).slice(0, -3) + 'aff'; - Zotero.debug(`Adding ${locale} dictionary`); - _spellChecker.addDictionary(locale, Zotero.File.pathToFile(affPath)); + let file = new FileUtils.File(affPath); + _spellChecker.addDictionary(locale, Services.io.newFileURI(file)); _dictionaries.push({ id, locale, version, dir }); } } diff --git a/chrome/content/zotero/xpcom/editorInstance.js b/chrome/content/zotero/xpcom/editorInstance.js index 94d8778b5c..b0aa5331ca 100644 --- a/chrome/content/zotero/xpcom/editorInstance.js +++ b/chrome/content/zotero/xpcom/editorInstance.js @@ -784,7 +784,7 @@ class EditorInstance { var menuitem = this._popup.ownerDocument.createXULElement('menuitem'); menuitem.setAttribute('label', Zotero.getString('spellCheck.addRemoveDictionaries')); menuitem.addEventListener('command', () => { - Services.ww.openWindow(null, "chrome://zotero/content/dictionaryManager.xul", + Services.ww.openWindow(null, "chrome://zotero/content/dictionaryManager.xhtml", "dictionary-manager", "chrome,centerscreen", {}); }); @@ -799,7 +799,7 @@ class EditorInstance { } let firstElementChild = this._popup.firstElementChild; - let suggestionCount = spellChecker.addSuggestionsToMenu(this._popup, firstElementChild, 5); + let suggestionCount = spellChecker.addSuggestionsToMenuOnParent(this._popup, firstElementChild, 5); if (suggestionCount) { let separator = this._popup.ownerDocument.createXULElement('menuseparator'); this._popup.insertBefore(separator, firstElementChild);