diff --git a/.luacheckrc b/.luacheckrc index 3de3dc84a..58eda1a43 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -121,6 +121,7 @@ read_globals = { "KOBO_LIGHT_ON_START", "NETWORK_PROXY", "DUSE_TURBO_LIB", + "STARDICT_DATA_DIR", "cre", "lfs", "lipc", diff --git a/defaults.lua b/defaults.lua index 3969f03db..14d60e450 100644 --- a/defaults.lua +++ b/defaults.lua @@ -251,6 +251,10 @@ NETWORK_PROXY = nil -- Use turbo library to handle async HTTP request DUSE_TURBO_LIB = false +-- Absolute path to stardict files (override) +-- By default they're stored in data/dict under dataDir. +STARDICT_DATA_DIR = nil + -- #################################################################### -- following features are not supported right now -- #################################################################### diff --git a/frontend/apps/reader/modules/readerdictionary.lua b/frontend/apps/reader/modules/readerdictionary.lua index d44ebe011..ccddeb73c 100644 --- a/frontend/apps/reader/modules/readerdictionary.lua +++ b/frontend/apps/reader/modules/readerdictionary.lua @@ -101,7 +101,8 @@ end function ReaderDictionary:init() self.ui.menu:registerToMainMenu(self) - self.data_dir = os.getenv("STARDICT_DATA_DIR") or + self.data_dir = STARDICT_DATA_DIR or + os.getenv("STARDICT_DATA_DIR") or DataStorage:getDataDir() .. "/data/dict" -- Gather info about available dictionaries