dual language versions of a 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
kuroi
Regular
Posts: 129
Joined: Fri Jun 29, 2007 10:50 am
Location: Albuquerque, New Mexico, USA
Contact:

dual language versions of a game

#1 Post by kuroi » Sun Aug 15, 2010 2:37 pm

Hello out there in Renpy Land.
I'm working on creating an updated version of one of my previous games and I was hoping to make the distribution simpler by having a dual-language english/japanese release. However, I can't seem to find any more elegent way to do this than to simply do an if statement for every single line of text in the game such as this:

Code: Select all

    if lang == "e":    
        main "Good Morning!"
    else:
        main "おはようございます!"
This seems like a terribly inefficient way to do things so I figure there must be some better way to do this which I haven't seen yet.

Ideally I'd really like for the player to be able to simply go into the options menu and switch their language at any time, however, I realize that this may not be possible within the renpy engine as it is right now.

So, does any have any ideas?

Thanks so much
~Kuroi
President, Planner, and Programmer for Kuroi Games!

fortaat
Regular
Posts: 183
Joined: Tue May 18, 2010 1:16 pm
Contact:

Re: dual language versions of a game

#2 Post by fortaat » Sun Aug 15, 2010 4:45 pm

I don't recall how Renpy is supposed to to do it, but the simplest way is to have a screen before the main menu, asking which language to play in:

Code: Select all

    if lang == "e":   
        jump to ENGLISH_GAME.RPY
    else:
        jump to JAPAN_GAME.RPY
Each option leads to a different file, with a different language.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: dual language versions of a game

#3 Post by PyTom » Sun Aug 15, 2010 7:37 pm

There's a pretty good writeup on this in the Ren'Py wiki:

http://www.renpy.org/wiki/renpy/doc/coo ... ge_Support
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
kuroi
Regular
Posts: 129
Joined: Fri Jun 29, 2007 10:50 am
Location: Albuquerque, New Mexico, USA
Contact:

Re: dual language versions of a game

#4 Post by kuroi » Sun Aug 15, 2010 7:42 pm

Oh. Wow... That was exactly what I was looking for. Thanks Pytom!
President, Planner, and Programmer for Kuroi Games!

Post Reply

Who is online

Users browsing this forum: Alex, nyeowmi