mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Vocabulary builder: store word context, other tweaks and fixes (#9195)
Add a copy button and save word context (off by default), shown via the three-dot menu of word entries. Also some db refactoring and minor UI improvements: - a dedicated book title table in order to shrink db size by storing references to title names instead of repeated actual strings, - alignment of different forms of the "more" button and possible clipped words in translations. - fix plugin name so it can be disabled
This commit is contained in:
@@ -888,13 +888,13 @@ function ReaderDictionary:stardictLookup(word, dict_names, fuzzy_search, boxes,
|
||||
return
|
||||
end
|
||||
|
||||
local book_title = self.ui.doc_settings and self.ui.doc_settings:readSetting("doc_props").title or _("Dictionary lookup")
|
||||
if book_title == "" then -- no or empty metadata title
|
||||
if self.ui.document and self.ui.document.file then
|
||||
local directory, filename = util.splitFilePathName(self.ui.document.file) -- luacheck: no unused
|
||||
book_title = util.splitFileNameSuffix(filename)
|
||||
end
|
||||
local book_title = self.ui.doc_settings and self.ui.doc_settings:readSetting("doc_props").title or _("Dictionary lookup")
|
||||
if book_title == "" then -- no or empty metadata title
|
||||
if self.ui.document and self.ui.document.file then
|
||||
local directory, filename = util.splitFilePathName(self.ui.document.file) -- luacheck: no unused
|
||||
book_title = util.splitFileNameSuffix(filename)
|
||||
end
|
||||
end
|
||||
|
||||
-- Event for plugin to catch lookup with book title
|
||||
self.ui:handleEvent(Event:new("WordLookedUp", word, book_title))
|
||||
|
||||
Reference in New Issue
Block a user