Multi-Language Help

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
WhiteMageChiu
Regular
Posts: 35
Joined: Thu Dec 12, 2013 8:35 pm
Completed: Two Steps Back
Projects: I Woke Up Because it Hurt, A Case of Two Souls Becoming One, In Which I Was Never the Hero
Organization: CureAll
Tumblr: chiuscanvas
Deviantart: inuyashatoysrule
Location: [The World]
Contact:

Multi-Language Help

#1 Post by WhiteMageChiu »

Hello there everyone! Having some issues figuring this out...

I've just about finished up my visual novel, but I want players to be able to chose between playing the game in english or german, I've been using http://www.renpy.org/wiki/renpy/doc/coo ... ge_Support but I must be overlooking something or missing something 'cause here's what happened:

A screen did pop up, asking if I wanted eng or germ, and I clicked on german since I wanted to see if my coding for that had worked. And now the game permanantly plays in german and even if i shut the game down and re-open it, I don't get the question anymore.

So I guess I accidentally perma germaned my game haha.. whoops.
If anyone could maybe point me in the right direction that'd be swell <3

Here's my code if that helps at all:

Code: Select all

# The game starts here.
init -3 python:
    if persistent.lang is None:
        persistent.lang = "english"

    lang = persistent.lang
    
label splashscreen:

    if not persistent.chose_lang:
        $ persistent.chose_lang = True
        jump language_chooser

    return
    
label language_chooser:
    scene black
    
    menu:
        "{font=DejaVuSans.ttf}English{/font}":
            $ persistent.lang = "english"
        "{font=DejaVuSans.ttf}German{/font}":
            $ persistent.lang = "german"


    $ renpy.utter_restart()
https://twitter.com/CureAllChiu
http://www.chiuscanvas.tumblr.com

Keep updated on my horror/ mystery visual novel [I Woke Up Because It Hurt!]
[Currently @ 20% completion- chugging along on coding, art, music. Writing completed]

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Multi-Language Help

#2 Post by Asceai »

It's working as intended, but you want to include preferences for language choice. Check out this page in the help file, and also have a look at Tutorial's screens.rpy, which contains this in the preferences screen:

Code: Select all

            # tutorial-only
            frame:
                style_group "pref"
                has vbox

                label _("Language")
                textbutton "English" action Language(None)
                textbutton u"日本語" text_font "tl/japanese/MTLc3m.ttf" action Language("japanese")
            # end-tutorial-only
[/s]

EDIT: Don't use the Ren'Py wiki. That page you linked is before Ren'Py even had multi-language support and instead opted to solve the problem with a manually-coded method. You don't want to do any of that. Read http://renpy.org/doc/html/translation.html instead and stay off the wiki.

I don't blame you, the wiki comes up first for a lot of things in Google, but sadly it is very out of date.

User avatar
WhiteMageChiu
Regular
Posts: 35
Joined: Thu Dec 12, 2013 8:35 pm
Completed: Two Steps Back
Projects: I Woke Up Because it Hurt, A Case of Two Souls Becoming One, In Which I Was Never the Hero
Organization: CureAll
Tumblr: chiuscanvas
Deviantart: inuyashatoysrule
Location: [The World]
Contact:

Re: Multi-Language Help

#3 Post by WhiteMageChiu »

Wow ok this is going so much smoother thank you so so much Asceai!!!

The only hiccup I'm seeing is that the German button that is now in my preferences menu is unclickable? The English button seems as though it is but nothing happens, I'm assuming since it's already in the English default.

Although I don't have all of the German text in... but I'm not sure if that has anything to do with the problem or not?
https://twitter.com/CureAllChiu
http://www.chiuscanvas.tumblr.com

Keep updated on my horror/ mystery visual novel [I Woke Up Because It Hurt!]
[Currently @ 20% completion- chugging along on coding, art, music. Writing completed]

User avatar
WhiteMageChiu
Regular
Posts: 35
Joined: Thu Dec 12, 2013 8:35 pm
Completed: Two Steps Back
Projects: I Woke Up Because it Hurt, A Case of Two Souls Becoming One, In Which I Was Never the Hero
Organization: CureAll
Tumblr: chiuscanvas
Deviantart: inuyashatoysrule
Location: [The World]
Contact:

Re: Multi-Language Help

#4 Post by WhiteMageChiu »

Think I may just private message you cause I really need a solution to this soon haha;;
https://twitter.com/CureAllChiu
http://www.chiuscanvas.tumblr.com

Keep updated on my horror/ mystery visual novel [I Woke Up Because It Hurt!]
[Currently @ 20% completion- chugging along on coding, art, music. Writing completed]

Post Reply

Who is online

Users browsing this forum: No registered users