mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add document language option in config dialog
Document language setting is used for better text extraction and OCR.
This commit is contained in:
@@ -6,7 +6,8 @@ function Configurable:hash(sep)
|
||||
local hash = ""
|
||||
local excluded = {multi_threads = true,}
|
||||
for key,value in pairs(self) do
|
||||
if type(value) == "number" and not excluded[key] then
|
||||
if type(value) == "number" or type(value) == "string"
|
||||
and not excluded[key] then
|
||||
hash = hash..sep..value
|
||||
end
|
||||
end
|
||||
@@ -28,8 +29,9 @@ end
|
||||
|
||||
function Configurable:loadSettings(settings, prefix)
|
||||
for key,value in pairs(self) do
|
||||
if type(value) == "number" or type(value) == "table" then
|
||||
saved_value = settings:readSetting(prefix..key)
|
||||
if type(value) == "number" or type(value) == "string"
|
||||
or type(value) == "table" then
|
||||
local saved_value = settings:readSetting(prefix..key)
|
||||
self[key] = (saved_value == nil) and self[key] or saved_value
|
||||
--Debug("Configurable:loadSettings", "key", key, "saved value", saved_value,"Configurable.key", self[key])
|
||||
end
|
||||
@@ -39,7 +41,8 @@ end
|
||||
|
||||
function Configurable:saveSettings(settings, prefix)
|
||||
for key,value in pairs(self) do
|
||||
if type(value) == "number" or type(value) == "table" then
|
||||
if type(value) == "number" or type(value) == "string"
|
||||
or type(value) == "table" then
|
||||
settings:saveSetting(prefix..key, value)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user