Ext Dictionaries definition overload doesn't work anymore since 2020.09
#1  Norbi24 11-16-2020, 05:41 AM
I am using this excellent function implemented here by @Pazos:

which makes it possible to use virtually any installed external dictionary app on Android, given it supports curresponding intent.

It has been working fine until 2020.08.1 (I am using the app picker variant,
where the dictonary is selected by app picker dialogue on its first usage attempt) but after update to 2020.10 the dictionary isnt's started anymore.

I tried to isolate the problem and found out that it stopped working already in 2020.09, and can reproduce it on my Samsung mobile (Android 8) with this simple dictionaries.lua (taken from Pazos's example in github link above)

return {
{ "Generic", "App picker", true, nil, "send" },
{ "ColorDict", "ColorDict", false, "com.socialnmobile.colordict", "colordict" },

If I copy this dictionaries.lua to koreader folder, both entries are shown if you go to ex. dictionary selection dialogue, but:

If you select app picker option, nothing happens afterwards, it doesn't work.
On the other hand, you are not able to select ColorDict, although it is installed on the Android.
Only if I change the boolean flag in the ColorDict line from false to true
(as not to check whether the app is installed), the I can select it and it really works !

I see that there were some changes in dictonaries handling, the list of predefined dictonaries was moved from dedicated frontend\device\android\dictionaries.lua file to frontend\device\android\device.lua
and perhaps there soomething happend ... I tried to understand the changes but do not know the LUA syntax so good (:-( so am not able to recognize it at first glance

Thanks, Norbert

#2  Frenzie 11-16-2020, 07:54 AM
return { { "Generic", "App picker", true, nil, "send" }, { "ColorDict", "ColorDict", false, "com.socialnmobile.colordict", "colordict" },
If you copy pasted this in full without accidentally skipping anything, then you're missing a closing brace.

It should look like this:
return { { "Generic", "App picker", true, nil, "send" }, { "ColorDict", "ColorDict", false, "com.socialnmobile.colordict", "colordict" },

#3  Norbi24 11-16-2020, 08:34 AM
Hi Frenzie, you are right, but I only missed closing brace here, in the koreader folder it was copied correctly, sorry for this confusion

#4  pazos 11-16-2020, 08:48 AM
Thanks @Norbi24 for the report.

Indeed generic actions (actions without an associated package) didn't work. should fix both your issues.

#5  Norbi24 11-16-2020, 10:37 AM

Today's Posts | Search this Thread | Login | Register