Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preferences: language names are translated into current locale #628

Open
GB609 opened this issue Dec 10, 2024 · 7 comments
Open

Preferences: language names are translated into current locale #628

GB609 opened this issue Dec 10, 2024 · 7 comments

Comments

@GB609
Copy link
Collaborator

GB609 commented Dec 10, 2024

When checking constants.py, i found that the value lists for language settings, SUPPORTED_DOWNLOAD_LANGUAGES and SUPPORTED_LOCALES, both pre-translate the titles used in the language selection combos into the current locale.

Nowadays such selection lists normally keep each entry in the respective selection's locale.
There's at least one reason for that: character sets. A language setting might accidentally have been set to another language with a character set that the user is not capable of reading. When all language names are also translated, finding and recovering the right setting might become a longer run of trial-and-error.

@sharkwouter
Copy link
Owner

When the user first starts Minigalaxy, their system language is used, though. I think we can assume that the user can read that. The drop down is just there to give the user the option to use another language if they prefer.

@GB609
Copy link
Collaborator Author

GB609 commented Dec 11, 2024

I wanted to also reuse these constants during windows game installations to map languages supported by the installer to the one selected in minigalaxy's preferences for when the installer does not return locale ids but language names.
But if you want to keep them as they are, we can also close this issue. I'm going to find another way then, like declaring a partly redundant mapping.

@sharkwouter
Copy link
Owner

The SUPPORTED_DOWNLOAD_LANGUAGES should contain all the languages GOG can have in their installers, but they might have added more.

@GB609
Copy link
Collaborator Author

GB609 commented Dec 11, 2024

The problem is how they are named and used by the installer when passing the /LANG= command line option during installation. A lot of the installers themselves support multiple languages. Its not about the key used to download the installer (if that is used there).
innoextract installer --list-languages returns 2 different value formats.

Either

 - en-Us
 - de-DE

Or

 - german: Deutsch
 - french: Francais

The first variant can easily be mapped and this is what lang_install currently does.
The second variant is not covered and lang_install falls back to en-US, which doesnt really work because the installer in that example expects keys like 'german' or 'french'.
The info to map that is there, theoretically. Just isnt done atm

@sharkwouter
Copy link
Owner

Oh, I wasn't aware of that. Maybe we could add the lower case English names for languages to the lists as well, but that would require some refactoring.

@sharkwouter
Copy link
Owner

GOG has since added more languages. We should update the list.
Screenshot from 2024-12-11 11-53-31

@GB609
Copy link
Collaborator Author

GB609 commented Dec 11, 2024

Isn't there an API where we could fetch the supported list of languages? That would be a more dynamic solution than just hard-coding all these values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants