Closed Sat1l closed 2 weeks ago
I like the idea of putting the language options in the firmware menu instead of creating a new menu.
Was able to find a person with actual hardware - firmware works and the sim issues are the same on there.
~~I was able to identify the issue with clock page raising a SEGFAULT. If the "< Back" button has more then 6 symbols closing the Clock page would cause a crash, and russian translation is "< Назад" which is 7 symbols. Still thinking on how to solve this issue and hoping someone with better lvgl knowledge could help~~ ok turned out it's also something else
Asian languages are really hard. I am from China and I plan to add only Chinese fonts. This means that every time I add a string, I need to update the fonts.
Asian languages are really hard. I am from China and I plan to add only Chinese fonts. This means that every time I add a string, I need to update the fonts.
Not exactly. One font in the four (4 different font sizes are used in the ui) sizes is sufficient. I haven’t experimented yet with the font loading, only used backup fonts. After adding a new string you just have to type one lv_i18n command to compile the .yml, and re-build the firmware. Other then Russian I tested it with some German and it worked fine
I did some Deepl translation and it kinda works. I as of now I solely rely on font-backups, but its not a rigid approach in any way shape or form.
Issues to target are:
As for the first one, if it's fine with you i can add an additional command to parse all of the used symbols in translations and generate the fonts only with the needed values.
So adding a new string would look like this: create a key - extract the key - write the key pair in english - write a value in any desired language - run a font-compile command.
This way we won't have to store hundreds of megs of .c fonts in a repo, the output fonts will be quire small, and we will have to only store one font file to generate all the sizes. This could also be done during ./setup.sh.
As for the font loader, if we do the compilation approach we won't require the loader since all of the symbols would be in one font. My goggles are being shipped, so when they arrive I'll test if including large font influences load time significantly.
@ligenxxxx I'm pending your opinion!
I plan to create PRs myself to implement multiple languages. https://github.com/hd-zero/hdzero-goggle/pull/452
so should I continue working on this pr or from now on internalization is your job?
so should I continue working on this pr or from now on internalization is your job?
You can wait for a while, let me try it first.
did this while finicking with branch names, if help is needed I'll create a new one
This PR introduces beta localisation features to HDZERO goggles firmware.
Some added things include:
.yml
localization files.What works:
.yml
file, compiling the languages, and rebuilding the firmware.After compiling the code with new languages, changing the firmware language is as easy as adjusting any other setting and rebooting
Current issues that make this PR a beta: