[SOLVED] Translated renpy.input box not translating

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
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

[SOLVED] Translated renpy.input box not translating

#1 Post by Kinmoku »

Hi all,

I have an input box in my game which wasn't translated. I added _() to the labels and was then able to generate new strings - great! However, the text inside the box remains in english.

Here's my code:

In script.rpy:

Code: Select all

$ povname = renpy.input(_("Enter your name below:"), _("Name"), length=20)
$ povname = povname.strip()
In (russian) script.rpy:

Code: Select all

# TODO: Translation updated at 2017-10-11 11:43

translate russian strings:

    # endings.rpy:1713
    old "Enter your name below:"
    new "Введи свое имя ниже"

    # endings.rpy:1713
    old "Name"
    new "Имя"
But when I test, only "Enter your name below" works, and "Name" remains in English. Any ideas?
Last edited by Kinmoku on Tue Oct 17, 2017 7:43 am, edited 1 time in total.

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: Translated renpy.input box not translating

#2 Post by Kinmoku »

Bump :(

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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: Translated renpy.input box not translating

#3 Post by PyTom »

Use a __ to translate the default. That's two underscores, rather than one.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: Translated renpy.input box not translating

#4 Post by Kinmoku »

PyTom wrote: Tue Oct 17, 2017 1:27 am Use a __ to translate the default. That's two underscores, rather than one.
Thanks Tom :D This worked!

So I understand, does it need 2 underscores because it's the second translation on the line?

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: [SOLVED] Translated renpy.input box not translating

#5 Post by Donmai »

Ah, I think I'm now closer to really understand what this part of the documentation means: https://www.renpy.org/doc/html/translat ... -variables
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot]