Ren'Py Use a different language only when in Replay

Tacito

Forum Fanatic
Jul 15, 2017
5,551
46,669
The scope is to use English or Italian language when in Replay mode , when exit from replay restore the original language setting.
I have translated in italian only the code related to Replay that is completely new , I don't want to touch the game code.

This is what I have done to set the new language in Replay and set original when exit:

Python:
screen main_menu():
        tag menu
        vbox:
            textbutton _("REPLAY") text_idle_color ... action Replay("setvarscene" , locked=False)

screen navigation():
        vbox:
            if _in_replay:
                textbutton _("End Replay") action (Language(actual_language) , EndReplay(confirm=False))


init 10:
    $ actual_language = _preferences.language

label setvarscene:
    $ actual_language = _preferences.language
    $ renpy.change_language("ita_sc") # start with italian language

# I can exit from replay also with:
textbutton _("End Replay") ... action (Language(actual_language) , EndReplay(confirm=False))
The good , it seems to work without problems.

There is a better way ?
Am I sure there is no problems with saves and the game itself ?

I am not a programmer , I do this for fun :)
Thanks
 
  • Like
Reactions: ▌Gin ▐