Ren'Py Can't make translations work

Kysyja

New Member
May 26, 2024
2
0
Did the translation for renpy by "generate translation" (there's the file for it with the translations . RPY and . RPYC) but getting it into the game is impossible. And I've googled and tried finding tutorials but for some reason none of them talk about this, just how to use outside programs to make translations. Renpy's tutorial doesn't have much on it either, definitely couldn't tell if any part explained how to get the English translations to go away and make the Russian ones work.

There's still the default English language on my vn so nothing I've tried has worked. Even tried to manually change the entire script for the game, one line at a time, but it doesn't recognize Cyrillic letters, so it's all dots.

I'm a complete newbie and could make a vn just by googling and following guides so I don't understand anything.

There was one suggestion of adding into screens.rpy

translate russian style default:
font "stonecutter.ttf"

translate russian python:
gui.text_font = "stonecutter.ttf"

Which does nothing.

And one person who lost his temper with me not understanding anything guided me to write into screens in screen preference() under the vbox, which should, I guess, give me the opportunity to get an option to switch languages in the game once I've opened it:

hbox:
frame:
style_prefix "check"
has vbox
label _("Language")
textbutton _("russian") action Language(None)
textbutton _("{font=SF-Display-Display-Regular.otf}CYRILLICFORRUSSIANHERE{/font}") action Language("russian")

hbox:textbutton _("{russian.otf} russia{/font}" )
action russian("russian")

And I just keep getting long strings of error-messages when I try to fire up the game.

Two more details: switched the fonts so it should show Cyrillic. And I accidentally gave the translation name "russia" So I've been writing the code for "russia" and Not "russian", So i hope that's not why it's not working?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,290
15,149
And I've googled and tried finding tutorials but for some reason none of them talk about this,
Really ? Not even ?


There's still the default English language on my vn so nothing I've tried has worked.
Even when using Ren'Py's , following the example code provided in the official documentation ?


Even tried to manually change the entire script for the game, one line at a time, but it doesn't recognize Cyrillic letters, so it's all dots.
This is not a Ren'Py issue, it's the font you're using that isn't Unicode compliant and don't have the said characters.



translate russian style default:
font "stonecutter.ttf"
That " " font, that is said to have bee created 29 years ago, and to contain only 129 characters ?
 

Kysyja

New Member
May 26, 2024
2
0
No, I can't find anything on the official guide what to do when the translation is finished.
It shows me how to get the translations done, what it looks like, and what things to take in consideration while adding translations.

If I launch the project, it's gonna be in English. I understand that you're trying to encourage me to look things up for myself, but I've worked on getting the translation to work for months, and I literally have no clue what to do. Like I said, coding is not a thing I know how to do. I've followed guides to get to this point, and asked around when I got stuck and couldn't find the answer. So here I am asking for help again after spending weeks trying to get someone's reluctant guide on how to make the translation work while he constantly belittled me and made fun of me for not understanding, until I couldn't just figure out what was wrong and I kept getting error messages. So I'd appreciate it if you - or anyone - could help me out, just please let me know what code I need and where exactly does it go. I won't learn how to do it otherwise.

I did at least change the font in my other visual novel and got the text to work, but not the game menu, setting screen etc., no clue how to translate those. Even the small portion with setting-names ("back" "skip" etc. ) I could find in Screens wouldn't translate in the visual novel. So I hope I can get the actual translation file to work somehow.


The official guide has this, but it doesn't say where it goes:

"The Language action can be used to add a language preference to the preferences screen:

frame:
style_prefix "pref"
has vbox

label _("Language")
textbutton "English" action Language(None)
textbutton "Igpay Atinlay" action Language("piglatin")"

If I understand this right, this means that it adds an option to switch between languages? Which is great if the visual novel would just recognize that Russian translation file i made for it - with the help of Renpy guide.


And there is this part, but I can't find any of these pieces of codes in any of the scripts, since I don't know where this could be, I used search bar, but it shows me nothing when I try to find renpy_language, config.language and so on:

" The default language is chosen using the following method:

If the RENPY_LANGUAGE environment variable is set, that language is used.

If config.language is set, that language is used, overriding all of the following.

If the game has ever chosen a language in the past, that language is used.

If this is the first time the game has been run and config.enable_language_autodetect is True, Ren'Py tries to autodetect the language using config.locale_to_language_function.

If this is the first time the game has been run, config.default_language is used.

Otherwise, the None language is used."
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,290
15,149
No, I can't find anything on the official guide what to do when the translation is finished.

The official guide has this, but it doesn't say where it goes:

"The Language action can be used to add a language preference to the preferences screen:
Are you sure that it doesn't say that it goes in "the preferences screen" ?

Screen that have high chances to be located in the "screen.rpy" file, and high chances to be named "preferences"...

As to "where in that screen", I'm pretty sure that once you have the said screen in front of you, you'll notice a similarity with its structure and the structure of the example code from the doc.



And there is this part, but I can't find any of these pieces of codes in any of the scripts, since I don't know where this could be, I used search bar, but it shows me nothing when I try to find renpy_language, config.language and so on:

" The default language is chosen using the following method:

If the RENPY_LANGUAGE environment variable is set, that language is used.

If config.language is set, that language is used, overriding all of the following.
config.language... config.... Could this be related to the configuration variables, and is it possible that explain at least one way to use them ?