In response to the comment by @ilyats on Weblate:
> Text appears in code twice, as menu item and as dialog button label. Ideally, translations should be different.
When trying to open/delete a supported document with empty name (eg .txt) got an error
./luajit: frontend/docsettings.lua:118: attempt to concatenate a nil value
Everything in string.gsub() is replaced, not only the matching group. By using two groups, we can correctly return the full matched string when none of the special conditions apply.
Fixes <https://github.com/koreader/koreader/issues/8486>.
Move Default and extra buttons above Cancel/OK.
Default values shown in the default button.
Precisions can be set for both values separately.
Minor geometry fix for consistence with SpinWidget.
Allow setting a folder as a book shortcut, with 2 options:
- open file browser: opens the FM in that folder
- last book: opens the most recently read book (via
ReadHistory) in that folder
Bookmark/highlight formats in crengine and mupdf are incompatible.
This backups and restores bookmarks and highlights when opening the
document with an incompatible engine, instead of deleting them.
Fuzzy searching doesn't work with CJK text: with Japanese,
we get large numbers of useless results because sdcv
decides to strip off the wrong part of the word.
It seems unlikely that sdcv correctly handles Korean
or Chinese, so just disable fuzzy searching on all
CJK-containing word lookups.
Add a "Select" button in the highlight dialog to initiate
text selection; on the next text selection, the text between
these 2 points will be selected.
Limited to a single page with non-CRE documents.
Also move "Search" button at end, so it's the one that
will be wide in case of an odd number of buttons.
Previously getTextFromBoxes would just pass the first and last three
bytes of the current and previous words when trying to detect CJK
characters (which shouldn't have spaces inserted).
However, this handling was not correct because CJK characters can be
longer than 3 bytes, and internally BaseUtil.utf8charcode doesn't ensure
that it was only given a single utf8 character (it blindly does the bit
operations on whatever length code you give it).
As a result, before this patch selections in PDF documents would have
lots of spaces stripped because getTextFromBoxes would think that almost
all characters were CJK characters.
Fixes: 6f1b70e5eb ("util.utf8: improve CJK character detection")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This layout is far more commonly used on mobile devices, and allows for
much easier typing. The keyboard primarily functions through gestures in
the four cardinal directions to select which vowel kana to select. In
addition, users can cycle through each kana row by tapping the key
within a 2-second window (this is the equivalent to T9 input for
Japanese phone keyboards).
This also resolves the long-standing issue that the old keyboard did not
correctly handle dakuten (there was a standalone dakuten key which added
a stray dakuten mark, and the umlat mode which added dakuten to all of
the keys it could) and could not input handakuten characters at all.
In order to allow adding dakuten and cycling through the various
modifiers for the previous kana, we need to wrap the input-box (similar
to korean) but luckily we don't need any state machine magic since we
just need to modify the last character in the character buffer. However
because the tap timeout for T9-like-cycling needs to be reset after any
non-tap key we need to add some basic wrappers around a few other
input-box methods.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
A layout might want to make some specific feature configurable, so
create an addToMainMenu-like system for allowing layouts to add their
own configuration sub-menu to the keyboard configuration menu.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This allows for InputText wrappers (namely the Japanese keyboard which
needs to be able to apply modifiers to the character before the cursor)
to nicely access the character list.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>