mirror of https://github.com/koreader/koreader
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
463 B
Lua
21 lines
463 B
Lua
4 years ago
|
local user_path = require("datastorage"):getDataDir() .. "/dictionaries.lua"
|
||
|
local ok, dicts = pcall(dofile, user_path)
|
||
|
|
||
|
local t = {}
|
||
|
|
||
|
table.insert(t, 1, { "Goldendict", "Goldendict", false, "goldendict" })
|
||
|
|
||
|
if jit.os == "OSX" then
|
||
|
table.insert(t, 1, { "Apple", "AppleDict", false, "dict://" })
|
||
|
end
|
||
|
|
||
|
if ok then
|
||
|
-- append user dictionaries to the bottom of the menu
|
||
|
for k, v in pairs(dicts) do
|
||
|
table.insert(t, #t + 1, v)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
return t
|
||
|
|