-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add language selector to login screen, use enums in localization code #125
Conversation
These were previously swapped. A locale is a language + region, e.g. en_us or fi_fi whereas a language is just the first part of a locale.
This is what it actually represents.
This complements the Locale enum and helps avoid string parsing each time the language is desired.
These will be used in both the server and client so they need to be moved to a place where they're available in both.
These are still converted to strings by consumers, but it's a first step towards using these strong types everywhere.
The repository has no .loc localization files so there's no point in keeping the code to load them around as it just makes TextManager harder to comprehend. Also, this enables simplifying the code path that is actually taken in loadLanguageFiles.
Now users can play the game in a different language without using CLI flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file needs to be cleaned up and deobfuscated at some point… I will open up and issue to keep track of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's one of the more difficult files to understand so I haven't touched it much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thank you!
I am happy to contribute German translation at some point 😄
This PR contains fixes and changes to the localization system with the ultimate end goal of having the user select their preferred language on the login screen instead of having to use CLI flags.
When users with different languages join a lobby together, they get grouped by language in the players list (see the bottom screenshots).