Translating text not extracted

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
Westeford
Regular
Posts: 152
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

Translating text not extracted

#1 Post by Westeford »

So I'm working on a translation project for my visual novel. So far I've been able to translate all the dialogue and most strings. However, there are a few things that remain blank. Specifically in places where I'm setting variables.

Code: Select all

$ hours_remain = "12 Hours Remain"
My immediate thought on how to work around this is something like this

Code: Select all

if language = different_language:
	$ hours_remain = "(translated text)"
	else:
		pass
but I haven't been able to figure something like that out. Is there a method I'm missing?
Thanks in advance.

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1061
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Translating text not extracted

#2 Post by m_from_space »

Westeford wrote: Tue Jun 11, 2024 6:17 am but I haven't been able to figure something like that out. Is there a method I'm missing?
Thanks in advance.
Yup, you just have to mark strings that you want to be recognized by Renpy and then show up in the translation files. You don't have to do anything else than put all strings inside the special underscore function. You said that you already knew about string translations, but for some reason you didn't do it in your example:

Code: Select all

$ hours_remain = _("12 Hours Remain")

Post Reply

Who is online

Users browsing this forum: konimyun