Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
I'm using this code for changing the language on my screen, but it doesn't work when I change the language. Always show the none option. What I'm doing wrong?
Your example is not how the RenPy translation system works.
The construction _("") you are using is necessary for the RenPy translation system to recognize that this string should be translated. For your screen you need only:
# game/script.rpy:<line number>
old "{color=#F313E4}Points:{/color} "
new "{color=#F313E4}Points:{/color} "
# game/script.rpy:<line number>
old "{color=#F313E4}Time:{/color} "
new "{color=#F313E4}Time:{/color} "
old show default language string, and new string you replace with translated string
Another note with translating displayables (as opposed to dialogue): some displayables only update on the next interaction. This means changing languages while that text is displayed requires rolling back to update the language. Using translation strings should prevent this in most cases, while the original code you have may require rolling back to work.
Main Website
Includes information about and links to many of my current and past projects.
Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series
_ticlock_ wrote: ↑Thu Feb 04, 2021 2:12 pm
Hi, neometalero,
Your example is not how the RenPy translation system works.
The construction _("") you are using is necessary for the RenPy translation system to recognize that this string should be translated. For your screen you need only:
# game/script.rpy:<line number>
old "{color=#F313E4}Points:{/color} "
new "{color=#F313E4}Points:{/color} "
# game/script.rpy:<line number>
old "{color=#F313E4}Time:{/color} "
new "{color=#F313E4}Time:{/color} "
old show default language string, and new string you replace with translated string
Renpy didnt generated translations for those items on the screen, that why I tryied to to it by hand
Working on many weird narrative games at Curse Box Studios
Jackkel Dragon wrote: ↑Thu Feb 04, 2021 3:27 pm
Another note with translating displayables (as opposed to dialogue): some displayables only update on the next interaction. This means changing languages while that text is displayed requires rolling back to update the language. Using translation strings should prevent this in most cases, while the original code you have may require rolling back to work.
Tks, I didnt knew that about displayables. Will check if rolling back works.
Working on many weird narrative games at Curse Box Studios