Is it possible to check if a certain language is enabled?

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
peachy
Newbie
Posts: 9
Joined: Wed Mar 20, 2019 5:10 pm
IRC Nick: peachy
Github: babiepeach
itch: babiepeach
Contact:

Is it possible to check if a certain language is enabled?

#1 Post by peachy »

I have both French and English translations avaliable but I want to make a disclaimer for the people who use French.
Is there a way to make a piece of text only show up for people who enabled the French language option?

Thanks:D

[I understand this is a shprt text post and I couldn't make it any longer without drawing it out to the point it'll be a bore to read. Sorry!]

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: Is it possible to check if a certain language is enabled?

#2 Post by Remix »

if not _preferences.language: # If French is the language the game was created in

if _preferences.language == "french": # (or whatever you called French) If French is one of the translated languages
Frameworks & Scriptlets:

peachy
Newbie
Posts: 9
Joined: Wed Mar 20, 2019 5:10 pm
IRC Nick: peachy
Github: babiepeach
itch: babiepeach
Contact:

Re: Is it possible to check if a certain language is enabled?

#3 Post by peachy »

Great! Thanks so much, it worked!

Post Reply

Who is online

Users browsing this forum: jeffster