Add menu language

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
frelon71
Newbie
Posts: 13
Joined: Sun Mar 28, 2021 11:14 am
Contact:

Add menu language

#1 Post by frelon71 » Sun Mar 28, 2021 11:31 am

Hello, I wanted to translate a game, it was in English and Russian and I want to put it in French, but cannot add the French language in the menu? I enclose you the original screens and the one I added tell me if I made a mistake and where? Thank you

I have this error when launching the game.

"I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.

File "game/screens.rpy", line 818: Tab characters are not allowed in Ren'Py scripts."

original.jpg
original 2.jpg

User avatar
laure44
Regular
Posts: 63
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Add menu language

#2 Post by laure44 » Sun Mar 28, 2021 10:02 pm

Hey there,

This kind of error happens when you use tab on certain text editors. You can simply remove tab characters from line 818. In your case, I assume those are the spaces at the beginning of this line.

You can replace the tab spaces with real spaces, then it should work.

I've never used Notepad++, but I heard that this editor use tab spaces for indentation when creating new lines. Maybe you can configure the editor to prevent that, or just use another another editor.

frelon71
Newbie
Posts: 13
Joined: Sun Mar 28, 2021 11:14 am
Contact:

Re: Add menu language

#3 Post by frelon71 » Tue Mar 30, 2021 10:11 am

Hello, thanks its working, but I have another problem as soon as I translate the text of the game, and there are accents é to or î it replaces it with an empty space in the game, do you know what to do ? thank you
test traduction.jpg

User avatar
laure44
Regular
Posts: 63
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Add menu language

#4 Post by laure44 » Tue Mar 30, 2021 10:33 am

Hey there,

This is most likely because the font you're using doesn't support accents.

frelon71
Newbie
Posts: 13
Joined: Sun Mar 28, 2021 11:14 am
Contact:

Re: Add menu language

#5 Post by frelon71 » Tue Mar 30, 2021 10:45 am

However I use the same font on another game that I translate at the same time and the accents work

User avatar
laure44
Regular
Posts: 63
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Add menu language

#6 Post by laure44 » Tue Mar 30, 2021 11:46 am

Strange. If you temporarily switch your font to the default one, do the special characters show up?
Also, could you put the link to the download page for your font (if there is one) please?

frelon71
Newbie
Posts: 13
Joined: Sun Mar 28, 2021 11:14 am
Contact:

Re: Add menu language

#7 Post by frelon71 » Tue Mar 30, 2021 12:28 pm

is that right to change the font?
police.jpg

User avatar
laure44
Regular
Posts: 63
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Add menu language

#8 Post by laure44 » Tue Mar 30, 2021 12:41 pm

I meant the font you are using for your game, probably a .ttf or .otf file somewhere in your game folder.

You can replace the font in the game in gui.rpy

What happens if you replace this line in gui.rpy :

Code: Select all

define gui.text_font = ...
with a default font, such as "DejaVuSans.ttf"? Do the accents work?

frelon71
Newbie
Posts: 13
Joined: Sun Mar 28, 2021 11:14 am
Contact:

Re: Add menu language

#9 Post by frelon71 » Tue Mar 30, 2021 1:09 pm

Thanks or its working, the font was 'cihuy.regular.ttf'

Post Reply

Who is online

Users browsing this forum: Google [Bot], Kaji