-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to share and/or copy into the clipboard dictionary definitions. #9336
Comments
On Android you can also easily use any other dictionary app btw, if that makes the workflow easier. |
I have for a period of time used a dictionary outside of Koreader but it was painfully slow and clunky, I use an Onyx boox e-reader and those are not optimize for multitasking at all. I quickly grew tired of my procedure, that's why the built in dictionary system in Koreader is so valuable to me, it's quick and doesn't need to transition to a third app. If only I could copy or share directly the content of the definition window it would be perfect. |
As we're short of place for more buttons, and as the use case is quite specific, you could help yourself with a User patch (available in next stable, or current nightlies). Download 2-dict-auto-copy-current-definition.lua.txt , remove the .txt extension, and drop it in koreader/patches/ (create this patches/ directory manually). local Device = require("device")
local DictQuickLookup = require("ui/widget/dictquicklookup")
local changeDictionary_orig = DictQuickLookup.changeDictionary
DictQuickLookup.changeDictionary = function(self, index, skip_update)
changeDictionary_orig(self, index, skip_update)
local text = self.displayword .. "\n" .. self.definition -- tweak this if needed
Device.input.setClipboardText(text)
end Any definition you see would be copied to clipboard (so, the last one replaces the previous one), and up to you to paste it or not into other apps. |
Oh yes I see, I have tried some of those but still ran into problems like fora would not format the text properly or look up sharing fonction would create its own card format in anki.... |
I'm gonna try that right now thank you! |
I will give it a try! But I'm a bit of a n00b here I was able to find the [2022.06] release but not the 2022.06000038 :/ |
@YashaNoos It has directories with most recent nightlies, go to appropriate directory and download for your OS, the same as for releases in Github |
Thank you!Well still unable to use the built in dictionary system using 2022.06000038 on a clean install, works perfectly on 2022.06. I'm just gonna be patient :) |
You could try the apk in this zip: |
@YashaNoos |
Your KOReader settings should stay as long as you keep /sdcard/koreader/ directory intact between installs/uninstalls |
Thanks for your help but even after a complete uninstall this apk (2022.06-7) refuse to install. I have tried other nightlies all install without any trouble but the dictionary problem remain though. |
Raw GitLab builds are unsigned. To install them you'd need to sign them. Android is terrible in this regard and it only gives you reasons for errors over ADB. Anyway, I triggered a build with #9340 so in an hour the latest nightly will have a working dictionary on Android. |
I'll try it and give feed back as soon I can. Really impressed by everyone reactivity! |
I just tried v2022.06-39 and not only the dictionary work perfectly now, but @poire-z patch works exactly as intended! |
Since the latest KOReader update, 2-dict-auto-copy-current-definition.lua seems to no longer function. Translations are now the only things that get automatically copied to the clipboard, and that happens regardless of the patch's presence. Does anyone happen to know what needs to be updated to get it working again? ..I'm terrible with lua patching... |
Well, no idea. You could try to display some notification in the user patch between each step, to see if it fails at some point, and display at the end what was put into the clipboard. local Device = require("device")
local DictQuickLookup = require("ui/widget/dictquicklookup")
local Notification = require("ui/widget/notification")
local changeDictionary_orig = DictQuickLookup.changeDictionary
DictQuickLookup.changeDictionary = function(self, index, skip_update)
Notification:notify("step 1", Notification.SOURCE_DISPATCHER)
changeDictionary_orig(self, index, skip_update)
Notification:notify("step 2", Notification.SOURCE_DISPATCHER)
local text = self.displayword .. "\n" .. self.definition
Notification:notify("step 3", Notification.SOURCE_DISPATCHER)
Notification:notify(text, Notification.SOURCE_DISPATCHER)
Device.input.setClipboardText(text)
Notification:notify("step 4", Notification.SOURCE_DISPATCHER)
Notification:notify(Device.input.getClipboardText(), Notification.SOURCE_DISPATCHER)
end and you could see: |
I'm using a space repetition system (anki) to build my English vocabulary while reading novel and I need to have the possibility to copy or share word's definitions into anki in order to create new cards. After searching for sometimes I was unable to find a way to grab the content of the built in dictionary's window.
Ideally, I would like to have a share or copy button within the dictionary window if possible.
I'm still learning how to use Koreader efficiently and if I missed the solution somewhere I'm sorry.
By the way, if it matters, I'm on Android. And really congratulation on the work done, it's the best reader I have used so far and I have tried MANY.
The text was updated successfully, but these errors were encountered: