luasettings: new module to handle genric settings

also use luasettings for reader settings
This commit is contained in:
Qingping Hou
2016-06-12 11:28:44 -07:00
parent a10a4f65a5
commit 85398dc2d5
2 changed files with 54 additions and 2 deletions

View File

@@ -25,12 +25,12 @@ if ffi.os == "Windows" then
ffi.C._putenv("PATH=libs;common;")
end
local DocSettings = require("docsettings")
local _ = require("gettext")
-- read settings and check for language override
-- has to be done before requiring other files because
-- they might call gettext on load
G_reader_settings = DocSettings:open(".reader")
G_reader_settings = require("luasettings"):open(
DataStorage:getDataDir().."/settings.reader.lua")
local lang_locale = G_reader_settings:readSetting("language")
if lang_locale then
_.changeLang(lang_locale)