Open degiz opened 1 year ago
UTF-16 shenanigans?
You can reproduce that using a UTF-8 encoded config file
menu_item :selection_search :Test Cyrillic :cmd_output :9999:echo 'Привет'
If that's a shenanigan issue, then I'm not sure what to do with it.
Can you upload (i.e., drag and drop into the attachment area) the syslog showing the execution of that item? Also, run the command manually, redirecting (not copy-pasting) the output into a file, and upload that too.
Hey @pgaskin
My config:
menu_item :main :Test russian :cmd_output :9999:echo 'Привет'
menu_item :main :Dump Syslog :cmd_spawn :logread > /mnt/onboard/.adds/syslog_bug.log
What I did:
Test russian
Attaching the syslog_bug.log
, I only stripped the first lines with book names.
Thanks a lot for looking into this!
This looks very similar to problems we've seen before when Cyrillic is used as part of the GUI. I think it's caused when the GUI is trying to use Cyrillic in a widget which is expecting to use the built-in default sans-serif font, Avenir.
I'm not sure whether it's because the Cyrillic glyphs in Kobo's version of Avenir are useless or whether it's because the Kobo can't find any Cyrillic glyphs and uses a fallback font instead, which will probably by one of the built-in CJK fonts.
Whatever the reason, one way it can be "fixed" is by replacing the default system 'Avenir Next' with a font better suited to Cyrillic. On my own devices I've replaced Avenir with a copy of Calibri masquerading as 'Avenir Next'. I didn't do this because I need Cyrillic but I have just tested
menu_item :main :Test russian :cmd_output :9999:echo 'Привет'
in NickelMenu and the output looks fine to me, i.e. no "double spacing" effect.
ETA: If NickelMenu could (optionally???) force the cmd_output
widget to use Georgia instead, that might also work.
Hey @pgaskin
When I use
cmd_output
to run a command that returns Cyrillic symbols, the formatting looks different than for Latin ones (attached photo). To me, it looks like there's a space inserted after every letter.My use case is to print translations received from DeepL, and all the available screen real estate matters 😅
Is it possible to display the Cyrillic symbols without offsets?
Hi, would you be so kind and share the line you used to get this output of translation. Are you using KOreader or anything similar or is this a device native reader?
Hey @n3w6i3 I'm using the following command:
menu_item :selection_search :DeepL Translation :cmd_output :9999:/usr/bin/wget --header='Authorization: DeepL-Auth-Key $MY_KEY' --post-data='target_lang=RU&text={1|S|%}' -qO - https://api-free.deepl.com/v2/translate | jq '.translations[0].text' | fold -s -w 55
No KOreader, pure Kobo + nickelmenu
Hey @n3w6i3 I'm using the following command:
menu_item :selection_search :DeepL Translation :cmd_output :9999:/usr/bin/wget --header='Authorization: DeepL-Auth-Key $MY_KEY' --post-data='target_lang=RU&text={1|S|%}' -qO - https://api-free.deepl.com/v2/translate | jq '.translations[0].text' | fold -s -w 55
No KOreader, pure Kobo + nickelmenu
I tried it (used my api key) but i get the following message instead of translation: /bin/sh: jq: not found... any idea how to solve it?
I ship it as part of my KoboStuff bundle of tools, so I imagine @degiz has that installed ;).
I ship it as part of my KoboStuff bundle of tools, so I imagine @degiz has that installed ;).
Thank you all, it works like a charm 😁
I ship it as part of my KoboStuff bundle of tools, so I imagine @degiz has that installed ;).
Thank you all, it works like a charm 😁
Wait, so how did you fix it?
I ship it as part of my KoboStuff bundle of tools, so I imagine @degiz has that installed ;).
Thank you all, it works like a charm 😁
Wait, so how did you fix it?
By installing the whole package from NiLuJe.
By installing the whole package from NiLuJe.
Ahhh I get it, rookie mistake. Now it works, this is very cool! Thanks :D
@degiz Hi!
Have you fixed it? Does replacing the default system 'Avenir Next' with something like 'Calibri' helped you? If so, how can I do it? Even after fixing 'double spacing' effect I still have a problem: Cyrillic (latin works as should) symbols at the end of the line are disappearing sometimes (pretty often but not always). E.g. with the longer text:
echo "\"Давай сходим в парк,\" - предложил Даниил, улыбаясь. \"Почему бы и нет,\" - согласилась Наташа, радостно кивнув. Они вышли из дома и направились к парку, наслаждаясь свежим воздухом. \"Какой замечательный день,\" - восхищенно вздохнула Наташа, глядя на яркое солнце. \"А вот и городское озеро,\" - указал Даниил, указывая на водную гладь. Они прогуливались, наслаждаясь природой и обществом друг друга. \"Скоро будем здесь снова,\" - обещала Наташа, улыбаясь своему другу. \"Да, это было замечательно,\" - согласился Даниил, чувствуя прилив счастья." | fold -s -w 50
@jackiew1 maybe you can also test it in your enviroment
P.S.
if you replace spaces (" "
) with "_"
for example, no characters will be missing
Hey @pgaskin
When I use
cmd_output
to run a command that returns Cyrillic symbols, the formatting looks different than for Latin ones (attached photo). To me, it looks like there's a space inserted after every letter.My use case is to print translations received from DeepL, and all the available screen real estate matters 😅
Is it possible to display the Cyrillic symbols without offsets?