RemoteTranslate: Use ZOTERO_CONFIG

This commit is contained in:
Abe Jellinek 2024-07-03 10:29:06 -04:00
parent 4619949678
commit 3e6cfaf9ac

View file

@ -25,15 +25,15 @@
var EXPORTED_SYMBOLS = ["RemoteTranslate"];
const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("chrome://zotero/content/actors/ActorManager.jsm");
ChromeUtils.defineESModuleGetters(this, {
Zotero: "chrome://zotero/content/zotero.mjs",
});
const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetters(this, {
TranslationManager: "chrome://zotero/content/actors/TranslationParent.jsm",
ZOTERO_CONFIG: "resource://zotero/config.js",
});
class RemoteTranslate {
@ -277,7 +277,7 @@ class RemoteTranslate {
}
_getPrefs(keys) {
let rootBranch = 'extensions.zotero.'; // ZOTERO_CONFIG isn't available here
let rootBranch = ZOTERO_CONFIG.PREF_BRANCH;
let prefs = {};
for (let key of keys) {
if (key.endsWith('.')) {