-
Notifications
You must be signed in to change notification settings - Fork 1
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 translation #9
Comments
I can do that i guess if you want bro 🤠 |
Sure. Here's some info to get you started:
If you want to create a new language:
If you're adding a new translated text to one of the language files:
# en.yml
en:
world:
themes:
default: Default
from game.utils.translator import translator as t # Importing the translator module
t.t('path.to.translated.text') # Getting the translated text using the translator
# The setter functions for changing the text varies from widget to widget:
label.set_text(TEXT_HERE) # For labels
button.label.set_text(TEXT_HERE) # For buttons
checkbox.title_label.set_text(TEXT_HERE) # For checkboxes
selectbox.set_tooltip_text(TEXT_HERE) # For selectboxes
# etc.
Feel free to look at the Si jamais tu vois des corrections à faire au niveau de ce qu'il y a déjà dans les fichiers yml (ou à l'avenir), n'hésites pas bien sûr. |
Hey, Few PR are already done for mainmenu_screen & gameover_screen. |
Don't forget to call the translate() methods inside the perform_translate() method of the screen_manager module. See here. |
Implement text translation and a language menu.
The text was updated successfully, but these errors were encountered: