Skip to content

[feature request] Add an option to select program interface language #33

Open

Description

@Bogdan107

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).

Activity

  1. u-235 commented on Oct 1, 2024

    @u-235
    Collaborator

    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.

  2. u-235 commented on Oct 1, 2024

    @u-235
    Collaborator

    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.

  3. Bogdan107 commented on Oct 5, 2024

    @Bogdan107
    Author

    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.

  4. u-235 commented on Oct 5, 2024

    @u-235
    Collaborator

    Commit 03e53eb adds code that switches the tooltip encoding to utf-8 for Qt5 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions