Page 1 of 1

Multilanguage game

Posted: Fri May 31, 2019 2:01 am
by richycapy
Hi,

I been searching and couldn't find the answer

Is there a way to make a game in two language? (English and Spanish)
Dialogs and RenPy platform


And allow the user to choose the language they want to use?

I hope someone can help, or point me in the right direction :D

Re: Multilanguage game

Posted: Fri May 31, 2019 2:57 am
by Matalla
Yes, you can do that easily (well... depending on the project, it could be not soo easy)

Actually, I'm now doing just that, translating my project from spanish to english.

You could start taking a look here:
https://www.renpy.org/doc/html/translation.html

And you can come to the spanish speaking community on discord and ask for help:

Re: Multilanguage game

Posted: Sun Jun 02, 2019 5:47 pm
by richycapy
Ok, I already have done that, so now I need to create a function o a command that when you press a button, it will change the lenguaje and restart the game

Something like this:

Code: Select all

def changelang(langtobe):
    Language(langtobe)
    $ renpy.full_restart()
Because if I do it like this:

Code: Select all

imagebutton auto "images/gui/botones/spanish_%s.png" hovered tt.Action("Juega el juego en espaƱol") action Language("spanish")
It doesn't restart the game and it doesn't change the menus or images already displayed :(

Can some one help me with this?

Also, how do you change it to its original lenguaje?
Like this? is not working for me:

Code: Select all

imagebutton auto "images/gui/botones/english_%s.png" hovered tt.Action("Play the game in english") action Language(None)

Re: Multilanguage game

Posted: Mon Jun 03, 2019 4:26 am
by Matalla
As far as I know, this is standard behaviour in renpy. You can change language midgame, but what's already displayed won't change.

Probably it would be a good idea to hide the buttons that change the language when in game, so it can only be done in the main menu, but probably the saved games would still be the same.

The code for changing languages seems right, at least the action part. Anyway, here's the code I use (and it's working), in my case the original is in spanish and the translated is english.

Code: Select all

                    imagebutton auto "gui/button/prefs/bt_spanish_%s.png":
                        action Language(None)
                    imagebutton auto "gui/button/prefs/bt_english_%s.png":
                        action Language("english")
Where have you placed the buttons? Preferences screen?

Re: Multilanguage game

Posted: Mon Jun 03, 2019 4:37 am
by Andredron