Translate dialog in other files

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
neometalero
Regular
Posts: 198
Joined: Sun Oct 23, 2016 3:51 am
Completed: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Projects: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Deviantart: neometalero
Contact:

Translate dialog in other files

#1 Post by neometalero »

I have a problem with the translation system. It works just fine for the dialog and text on "script. rpy" but I have dialog in other files that it doesn't recognise when creating the translated string. How can I manually indicate the translation of this text?
Working on many weird narrative games at Curse Box Studios
Image
https://www.curseboxstudios.com/

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Translate dialog in other files

#2 Post by Remix »

How are you declaring the text?

If it is in .rpy files and wrapped in _() the translation system should pick it up when generating translations
Frameworks & Scriptlets:

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Translate dialog in other files

#3 Post by Remix »

For example:

arg.rpy

Code: Select all

default novar = "no bob"
default argvar = _("bob")

init python:

    pynovar = "py no bob"
    pyargvar = _("py bob") 
Generate Translations >>

tl/de/arg.rpy

Code: Select all

translate de strings:

    # game/arg.rpy:2
    old "bob"
    new "bob"

    # game/arg.rpy:7
    old "py bob"
    new "py bob"
Note how it has skipped all those not enclosed by the _() symbols
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Black Spriggan, Majestic-12 [Bot], Semrush [Bot], snotwurm