-
Notifications
You must be signed in to change notification settings - Fork 185
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
Added multi language support. The language can now be switched (Need translation) #216
base: master
Are you sure you want to change the base?
Conversation
…is not yet saved in the settings storage. I also started the translation process, by removing hardcoded strings and replacing them with keys, so they are found in the JSON files. And lastly added a new menu entry, which looks really messy, but changing the language works.
Hey, first of all this looks really nice, me and @MaFeLP will look into this. Funny how you chose German as the second language xD. |
I would suggest removing the |
Yeah German is my main language so I thought I would go for it :) |
Hey, All this also begs the question of what else should be translated, besides dialogues (some of which just work in the englisch language), headings etc. also Pokete and attack infos have to be translated, the Pokete names them selfs should stay though. Another issue I see with the translations is that things like the minimum supported terminal resolution of 70*20 has to be maintained in other languages, as well as the texts it self have to be maintained in different languages, english and german are no challenge to me, but when other languages are added those have to be maintained too, especially when new features or parts of the map are added. As far as I see you outsourced the menu from And as of the newly added setting isn't yet savable I will look into how incorporate this into the already present settings system, this may also obsolete the language overlay menu, since Greetings |
try: | ||
import scrap_engine as se | ||
except ImportError: | ||
print("You seem to not have the 'scrap-engine' package installed") | ||
|
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.
I don't know if this is really necessary, since python itself will throw an error about this and this isn't even the first file to import scrap_engine.
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 this was kind of a test I forgot to remove. I thought it would be nice to fetch all the required packages on startup first and see if all are available, otherwise a message with all the missing packages will be printed. But I wasn't able to implement this behavior yet :o
I now added the integration with the settings and therefore changed some stuff in the language class. |
I would also like you to take a look at that code. |
…tance directly in the class, it is passed in as parameter (DI), so I could test the class properly. Furthermore I have added a new method in the Settings class to get the setting via a method call, instead of relying on magic functions. I have also added a fallback language (en_US), which can be modified in the constants.py file, to load these language strings if no translation can be found in the current language file.
Yes everything looks correct, except that part where you commented out the language file existence check. As everything is dynamic, it would be good to check for existence first. I also added a fallback language which can be changed in the constants.py file. Look at b9eead8 for more information. |
Then I think it would also be great to make the setting in the menu to select the language it self dynamic, so that when new languages are added, the keys are determined by what files are present. To also get the languages name, like hardcoded right now, the translation files it self could contain such a name. |
I will also look into the extending the German translation. Oh, and I also think translating logging messages isn't a good idea, since those should be reproducable and the same no matter the language. |
Just made a new push with more translations. Yeah I also translated the logs, since I believe it is kind of interesting to play with translated logs xd, but it can be reverted if important to do so. I think I got most of the language strings in the classes folder, if there are any left, then let me know! Cheers. |
Hey, Cheers |
Hey, this is a future problem, for now we need the translation for the different languages. The wiki can be modified later on :) |
Also sorry for my late response, I'm currently prepping for exams, have the last one in one week. Then I can make more translation stuff |
Good luck! |
I may have added some additional whitespaces in the used data structures. But I think that is not such a huge problem.
Alright new commitments are done. Please check them out. I separated the commits that might be problematic with the current idea of the game, so it can be easily reverted. |
Oh, that's very nice. I hope your exam went good. But I think the translatable Pokete names are not a good idea, because some Pokete name like steini, vogli etc. already have a deep connection to in this case the german language and therefore don't really have a german translation. It was also a hassle to make up the names in the first place and now having to imagine most of the names is a lot of work. |
My idea behind translating the names was, that some names have a pun intended. But you may not get it when playing the game in english, so I thought it would be nice for the translators to make the pun work in other languages, besides german. But this is just an idea and I can revert that change if this feature is not planned. Aaaand yes my exams went absolutely perfect, thank you for asking! :D ^^ |
Hey,
That's very nice to hear.
Hmm, that's a very good idea, but I don't know whether or not I like it. Cheers |
Made audio volume use `Settings` and backported additions to settings made in lxgr-linux#216
Sorry for the late reply. I'm really split on this topic. On one hand, I'm liking the idea of having puns, not everyone can understand, on the other hand, the names of Pokémon (in the original) are also (partially) translated. Therefore, changing pokete's names should depend on the pokete itself and the language. For example having a |
@MaFeLP I agree with you, just partially translate Pokete names is better than translating all pokete names. But for Poketes like And are the overall commits I have done so far acceptable or do I need to change something? Cheers |
…is not
yet saved in the settings storage. I also started the translation process,
by removing hardcoded strings and replacing them with keys, so they are
found in the JSON files.
And lastly I added a new menu entry, which looks really messy, but changing
the language works without restart.