[solved] Problems translating screen voice variable

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
ComputerArt.Club
Veteran
Posts: 427
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

[solved] Problems translating screen voice variable

#1 Post by ComputerArt.Club »

I have voice recordings that I want to play in a screen, but it is not coming up in the translation scripts. The voice file name is a variable, it works for English, but for other languages it also just plays English.

Code: Select all

on "show" action Queue ("voice", _([quiz_voice]))
I get errors if I add "", presumably as that would make it a string, though I think it also makes it appear in the translation file.
I believe I need to change it to [quiz_voice!t] and then see what happens. If I add [quiz_voice!t] for the English version, it also gets an invalid syntax error.

Any ideas thoughts or suggestions?
Thanks for taking the time to read this. :)
Last edited by ComputerArt.Club on Mon Jul 22, 2019 10:53 am, edited 2 times in total.

User avatar
Andredron
Miko-Class Veteran
Posts: 719
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Problems translating screen voice variable

#2 Post by Andredron »

ComputerArt.Club wrote: Mon Jul 22, 2019 4:27 am I have voice recordings that I want to play in a screen, but it is not coming up in the translation scripts. The voice file name is a variable, it works for English, but for other languages it also just plays English.

Code: Select all

on "show" action Queue ("voice", _([quiz_voice]))
I get errors if I add "", presumably as that would make it a string, though I think it also makes it appear in the translation file.
I believe I need to change it to [quiz_voice!t] and then see what happens. If I add [quiz_voice!t] for the English version, it also gets an invalid syntax error.

Any ideas thoughts or suggestions?
Thanks for taking the time to read this. :)
Suppose the default language is None - English, his English voice files are here - game / voice / voice001.ogg and so on.

You need china voice.
China voice files, you throw in the folder:

game / tl / china / voice / voice001.ogg

Those. Files with the same name should be, so that they replace the voice of None (English), the language of china.

And that at the same time 2 languages would sound, make 2 folders in the game folder:

game / voice_en /
AND
game / voice_ch /

And you duplicate the translation in the same way:

game / tl / china / voice_en
game / tl / china / voice_ch

Where in the folder voice_en - voice china

And in the folder voice_ch - voice None (English) voice.

User avatar
Andredron
Miko-Class Veteran
Posts: 719
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Problems translating screen voice variable

#3 Post by Andredron »

Files must be the same format and name.

And be in similar folders.

Google translation damn ... It seems it is not clear his thought explain ...

User avatar
ComputerArt.Club
Veteran
Posts: 427
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: Problems translating screen voice variable

#4 Post by ComputerArt.Club »

Andredron wrote: Mon Jul 22, 2019 5:18 am
ComputerArt.Club wrote: Mon Jul 22, 2019 4:27 am I have voice recordings that I want to play in a screen, but it is not coming up in the translation scripts. The voice file name is a variable, it works for English, but for other languages it also just plays English.

Code: Select all

on "show" action Queue ("voice", _([quiz_voice]))
I get errors if I add "", presumably as that would make it a string, though I think it also makes it appear in the translation file.
I believe I need to change it to [quiz_voice!t] and then see what happens. If I add [quiz_voice!t] for the English version, it also gets an invalid syntax error.

Any ideas thoughts or suggestions?
Thanks for taking the time to read this. :)
Suppose the default language is None - English, his English voice files are here - game / voice / voice001.ogg and so on.

You need china voice.
China voice files, you throw in the folder:

game / tl / china / voice / voice001.ogg

Those. Files with the same name should be, so that they replace the voice of None (English), the language of china.

And that at the same time 2 languages would sound, make 2 folders in the game folder:

game / voice_en /
AND
game / voice_ch /

And you duplicate the translation in the same way:

game / tl / china / voice_en
game / tl / china / voice_ch

Where in the folder voice_en - voice china

And in the folder voice_ch - voice None (English) voice.
Thanks for this! You are awesome!

It looks like this could lead to the answer, though I expect it will also create new problems in the short run as I will need to undo all my previous attempts to change the names of the voice files.

For other people who are experiencing the same problem that I was, my audio files were all originally directly in the game folder, I did not have a voice subfolder, and I have now put them directly into the game\tl\chinese folder. I assume that if I had had a voice folder, it would be in game\tl\chinese\voice, it needs to mimic the relationship of the original files to the game directory. I did not need to change any code or tell Renpy where the folders were. It was automatic.

Checking the documentation again, I guess this comes under image and file translations: https://www.renpy.org/doc/html/translat ... anslations

Thanks again!


Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Google [Bot], Semrush [Bot]