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:
zwim
2021-05-31 20:34:26 +02:00
committed by GitHub
parent b30e366ccd
commit f25da5d0d5
39 changed files with 355 additions and 256 deletions

View File

@@ -48,6 +48,7 @@ local ReaderStyleTweak = require("apps/reader/modules/readerstyletweak")
local ReaderToc = require("apps/reader/modules/readertoc")
local ReaderTypeset = require("apps/reader/modules/readertypeset")
local ReaderTypography = require("apps/reader/modules/readertypography")
local ReaderUserHyph = require("apps/reader/modules/readeruserhyph")
local ReaderView = require("apps/reader/modules/readerview")
local ReaderWikipedia = require("apps/reader/modules/readerwikipedia")
local ReaderZooming = require("apps/reader/modules/readerzooming")
@@ -314,6 +315,12 @@ function ReaderUI:init()
view = self.view,
ui = self
})
-- user hyphenation (must be registered before typography)
self:registerModule("userhyph", ReaderUserHyph:new{
dialog = self.dialog,
view = self.view,
ui = self
})
-- typography menu (replaces previous hyphenation menu / ReaderHyphenation)
self:registerModule("typography", ReaderTypography:new{
dialog = self.dialog,