Multilanguage game

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.
Post Reply
Message
Author
User avatar
richycapy
Regular
Posts: 51
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

Multilanguage game

#1 Post by richycapy » Fri May 31, 2019 2:01 am

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

User avatar
Matalla
Veteran
Posts: 202
Joined: Wed Mar 06, 2019 6:22 pm
Completed: The Lost Smile
itch: matalla-interactive
Location: Spain
Contact:

Re: Multilanguage game

#2 Post by Matalla » Fri May 31, 2019 2:57 am

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:
Comunidad Ren'Py en español (Discord)
Honest Critique

User avatar
richycapy
Regular
Posts: 51
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

Re: Multilanguage game

#3 Post by richycapy » Sun Jun 02, 2019 5:47 pm

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)

User avatar
Matalla
Veteran
Posts: 202
Joined: Wed Mar 06, 2019 6:22 pm
Completed: The Lost Smile
itch: matalla-interactive
Location: Spain
Contact:

Re: Multilanguage game

#4 Post by Matalla » Mon Jun 03, 2019 4:26 am

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?
Comunidad Ren'Py en español (Discord)
Honest Critique

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Multilanguage game

#5 Post by Andredron » Mon Jun 03, 2019 4:37 am

I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

Post Reply

Who is online

Users browsing this forum: Bing [Bot]