From 72e5574ca744e9140bdf29c54b94cb2d59ddbee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fern=C3=A1ndez?= Date: Tue, 3 Dec 2019 16:28:57 +0100 Subject: [PATCH] android: allow overrides on 3rd party dictionary list --- frontend/device/android/dictionaries.lua | 32 +++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/frontend/device/android/dictionaries.lua b/frontend/device/android/dictionaries.lua index eacc83434..ed69a5486 100644 --- a/frontend/device/android/dictionaries.lua +++ b/frontend/device/android/dictionaries.lua @@ -1,15 +1,19 @@ -return { --[[ supported android dictionary applications. +local user_path = require("datastorage"):getDataDir() .. "/dictionaries.lua" +local ok, dicts = pcall(dofile, user_path) -Most of them should support Intent.ACTION_SEND, Intent.ACTION_SEARCH or -Intent.ACTION_PROCESS_TEXT. Some applications implement their custom intents. ]]-- - - { "Aard2", "Aard2", false, "itkach.aard2", "aard2" }, - { "Alpus", "Alpus", false, "com.ngcomputing.fora.android", "search" }, - { "ColorDict", "ColorDict", false, "com.socialnmobile.colordict", "colordict" }, - { "Fora", "Fora Dict", false, "com.ngc.fora", "search" }, - { "GoldenFree", "GoldenDict Free", false, "mobi.goldendict.android.free", "send" }, - { "GoldenPro", "GoldenDict Pro", false, "mobi.goldendict.android.pro", "send" }, - { "Kiwix", "Kiwix", false, "org.kiwix.kiwixmobile", "text" }, - { "Mdict", "Mdict", false, "cn.mdict", "send" }, - { "QuickDic", "QuickDic", false, "de.reimardoeffinger.quickdic", "quickdic" }, -} +if ok then + return dicts +else + return { + -- tested dictionary applications + { "Aard2", "Aard2", false, "itkach.aard2", "aard2" }, + { "Alpus", "Alpus", false, "com.ngcomputing.fora.android", "search" }, + { "ColorDict", "ColorDict", false, "com.socialnmobile.colordict", "colordict" }, + { "Fora", "Fora Dict", false, "com.ngc.fora", "search" }, + { "GoldenFree", "GoldenDict Free", false, "mobi.goldendict.android.free", "send" }, + { "GoldenPro", "GoldenDict Pro", false, "mobi.goldendict.android.pro", "send" }, + { "Kiwix", "Kiwix", false, "org.kiwix.kiwixmobile", "text" }, + { "Mdict", "Mdict", false, "cn.mdict", "send" }, + { "QuickDic", "QuickDic", false, "de.reimardoeffinger.quickdic", "quickdic" }, + } +end