You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[feature request] Add an option to select program interface language #33
I have two separate linux machines:
1 - my own laptop, Gentoo, default language - uk_UA (LANGUAGE=uk)
2 - remote machine, Ubuntu 24.04, default language ru_RU.
Machine 1:
program interface language is English;
cyrillic characters, stored in cnc_tips.txt, are shown good.
Machine 2:
program interface language is Russian;
cyrillic characters, stored in cnc_tips.txt, are shown as unreadable characters.
I want an option to select program interface language manually.
Now, I can run program in machine 1 with Russian interface by command:
LANGUAGE=ru_RU gcodeworkshop
But this is non-standard way...
Please:
add an option to the .config/gcodeworkshop/gcodeworkshop.ini, which can configure program language or use default procedure to select translation file;
add message-box to select supported language from /usr/share/gcodeworkshop/lang and store selected value to gcodeworkshop.ini (so, at next start program will use expected translation file).
The tooltip file is parsed using the QSettings class, whose documentation says:
Following the philosophy that we should be liberal in what we accept and conservative in what we generate, QSettings will accept Latin-1 encoded INI files, but generate pure ASCII files, where non-ASCII values are encoded using standard INI escape sequences. To make the INI files more readable (but potentially less compatible), call setIniCodec().
But by default GCodeWorkShop saves files in the system encoding, in Linux it is utf-8. So because of encoding mismatch it is very difficult to get correct display of Cyrillic characters. Perhaps Gentoo maintainers have patched Qt5 and QSettings accepts utf-8 without any additional settings on the application side. Or did you build the application with Qt6?
As mentioned, in Qt5 the application has the option to set its own codec using QSettings::setIniCodec(), I think the most correct option is to set utf-8.
I was thinking about the possibility of selecting the localization language, but now the application cannot change the localization without restarting. Therefore, the implementation of this feature is postponed for now.
But by default GCodeWorkShop saves files in the system encoding, in Linux it is utf-8. So because of encoding mismatch it is very difficult to get correct display of Cyrillic characters. Perhaps Gentoo maintainers have patched Qt5 and QSettings accepts utf-8 without any additional settings on the application side. Or did you build the application with Qt6?
Yes, I use Qt6 with PC, which show Cyryllic symbols correctrly.
Activity
u-235 commentedon Oct 1, 2024
The tooltip file is parsed using the QSettings class, whose documentation says:
But by default GCodeWorkShop saves files in the system encoding, in Linux it is utf-8. So because of encoding mismatch it is very difficult to get correct display of Cyrillic characters. Perhaps Gentoo maintainers have patched Qt5 and QSettings accepts utf-8 without any additional settings on the application side. Or did you build the application with Qt6?
As mentioned, in Qt5 the application has the option to set its own codec using QSettings::setIniCodec(), I think the most correct option is to set utf-8.
u-235 commentedon Oct 1, 2024
I was thinking about the possibility of selecting the localization language, but now the application cannot change the localization without restarting. Therefore, the implementation of this feature is postponed for now.
Bogdan107 commentedon Oct 5, 2024
Yes, I use Qt6 with PC, which show Cyryllic symbols correctrly.
u-235 commentedon Oct 5, 2024
Commit 03e53eb adds code that switches the tooltip encoding to utf-8 for Qt5 as well.