|
|
#1321 |
|
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10
Karma: 87422
Join Date: Sep 2012
Device: Kobo Libra
|
Could I request a patch for enabling the "Japanese" dictionary lookup functionality for Chinese dictionaries? (basically enabling DictionaryParser::htmlForWordJapanese() for not only Japanese, but also Chinese)
I'm using a custom Chinese-English dictionary, but I have to masquerade it as a Japanese-English dictionary by renaming it dicthtml-ja-en.zip. (Advice from this thread, thanks tshering for all the pointers). The issue is that I also want a Japanese-English dictionary. I know I can workaround by masquerading them as ja-es or ja-it dictionaries, but I think it's possible to make a patch to support both ja-en and zh-en dictionaries. I read through the code and docs for dictutil. From my understanding: - For English and other languages: uses 2-character prefixes, calls DictionaryParser::htmlForWordNonJapanese() - For Japanese: uses 1-character prefixes DictionaryParser::htmlForWordJapanese(). Chinese should also use this since they both use kanji/hanzi; however, this code path is hardcoded for only the 'ja' locale. I poked around in libnickel.so using objdump/nm (with some assistance from an LLM), and I think it all boils down to the hardcoded check in DictionaryProvider::getDefinition(): Code:
// Reconstructed code from disassembled thumb code
QString locale = dictionary.leftLanguage();
bool useJapanesePath = (locale == QLatin1String("ja"));
htmlForWord(word, useJapanesePath); // branches on htmlForWordJapanese() vs htmlForWordNonJapanese()
I asked my LLM to take a look at my libnickel.so and draft a patch for kobopatch (Kobo Libra Colour, FW 4.45.23697). However there's a high potential it could be hallucinating since I don't have the proper ARM assembly knowledge to verify anything and I'm too scared to apply it. Maybe someone here with more expertise could take a look at this to see if it holds water? Spoiler:
|
|
|
|
|
|
#1322 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,838
Karma: 7454317
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD, Clara BW, Libra Colour
|
You should be good to try it, the worst that'll happen in this case is a crash when you use the dictionary. The logic looks sane, but I didn't actually look at the instructions surrounding it, so I can't tell you if it'll work.
|
|
|
|
|
|
#1323 |
|
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10
Karma: 87422
Join Date: Sep 2012
Device: Kobo Libra
|
Thanks for the reassurance, I just applied the patch on 4.45.23697 on my Libra Colour, works like a charm! I'm using the Chinese-English dictionaries I generated which I posted here. I kept the name as dicthtml-zh-en.zip and it works blazingly fast since it is using Japanese kanji lookup logic.
By the way, I was playing with your libnickel dictword-test tool, and I realized the function signatures and symbol names have changed since 2020. It looks Rakuten did some refactoring for the dictionary lookup logic, so the non-Japanese vs Japanese lookup is just a simple boolean flag passed to DictionaryParser::htmlForWord(QString const&, bool), so Japanese lookup is trivial to implement now. I submitted a PR here: https://github.com/pgaskin/kobo-mods/pull/8 |
|
|
|
|
|
#1324 |
|
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10
Karma: 87422
Join Date: Sep 2012
Device: Kobo Libra
|
Never mind, I don't think this patch is necessary anymore. I came across information about the prefix_exceptions trie file in your mobileread thread and the dictutil github thread, and was able to build an index of Chinese word -> single-char hanzi prefixes (no variants needed).
This skips the Japanese lookup path completely, but still works and is pretty fast. |
|
|
|
|
|
#1325 |
|
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Aug 2026
Device: Kobo Clara Colour
|
I have a very nitpicky patch request - the ability to show the <page> of <totalPages> AND percentage in the footer at the same time.
I know that I could turn on the progress indicator bar and get some of that, but it's just a preferred option I would love to see. I'm sure others would utilize it to a degree as well. |
|
|
|
|
|
#1326 | |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 336
Karma: 1028630
Join Date: May 2024
Location: Salisbury, UK
Device: Assorted Kobo, Boox, PocketBook & Kindle readers
|
Quote:
As it happens, I have both visible in my status bar when I use KOReader. |
|
|
|
|
|
|
#1327 | |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 328
Karma: 50000
Join Date: May 2014
Device: Kobo Libra 2
|
Quote:
If you go to the GitHub page linked above, you will see that their example footer has the book title, page number*, percent read, AND time remaining as the left footer, and battery and clock as the right footer. And you aren't forced to have the kitty in the folded bookmark image. I also like that it can hide the battery until it drops to a certain percentage (I have it at 20%). * page number is displayed as 4/312, not 4 of 312. There's a request on the GitHub to offer "of" display. Last edited by fogice; Today at 04:38 PM. |
|
|
|
|
|
|
#1328 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84,568
Karma: 153744815
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
|
|
|
|
#1329 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 328
Karma: 50000
Join Date: May 2014
Device: Kobo Libra 2
|
|
|
|
|
![]() |
| Tags |
| kobopatch, patches, patching, request, requests |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Request for PW3 kernel [posted in another thread] | mustdie | Kindle Developer's Corner | 5 | 10-21-2015 04:28 PM |
| Kobobooks.com future feature request thread | Mrs_Often | Kobo Reader | 47 | 11-08-2012 11:59 AM |
| [Old Thread] Calibre 'feature request' thread | Waba | Calibre | 2 | 02-10-2010 07:52 PM |
| Feature request thread? | Dahak | Calibre | 1 | 08-02-2009 12:51 AM |
| 3rd party software request thread | Adam B. | iRex | 23 | 11-28-2008 01:08 PM |