mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Hyphenation: add custom hyphenation rules (#7746)
The hyphenation of a word can be changed from its default by long pressing for 3 seconds and selecting 'Hyphenate'. These overrides are stored in a per-language file, i.e: koreader/settings/user-German.hyph.
This commit is contained in:
@@ -169,6 +169,20 @@ function ReaderHighlight:init()
|
||||
}
|
||||
end)
|
||||
|
||||
-- User hyphenation dict
|
||||
self:addToHighlightDialog("11_user_dict", function(_self)
|
||||
return {
|
||||
text= _("Hyphenate"),
|
||||
show_in_highlight_dialog_func = function()
|
||||
return _self.ui.userHyph and _self.ui.userhyph:isAvailable() and not _self.selected_text.text:find("[ ,;-%.\n]")
|
||||
end,
|
||||
callback = function()
|
||||
_self.ui.userhyph:modifyUserEntry(_self.selected_text.text)
|
||||
_self:onClose()
|
||||
end,
|
||||
}
|
||||
end)
|
||||
|
||||
self.ui:registerPostInitCallback(function()
|
||||
self.ui.menu:registerToMainMenu(self)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user