Tool RenPy Translation tool

5.00 star(s) 4 Votes

OutisNemo

New Member
Sep 28, 2018
10
5
They are plain text files. Use any text editor, even windows' notepad, and it will do it. Just look at what is already in the file to understand the syntax, but it's really not something complicated.
Search in the file to find a sentence you exactly know where to see in the game, keep a copy of this file, then translate the sentence and validate with the game that it effectively works fine. But it shouldn't have surprises.
Did you figure out how the den/lair menu works? It doesn't seem to get translated using the yaml files and it wasn't translated by the renpy parser of QSPTool.
 

v01d_08

Member
Modder
Jan 2, 2018
233
304
New version 0.04

1. Added support of dialogues with explicit character name (thanks to revoluta for pointing to it in post).
Now if character name is in double quotes, and then comes a dialog itself, the tool will handle it propperly. Even if there are some code words after the dialogue. For example:
"Elisa" "Hello, my friend" text_color gui.idle_color
2. Fixed functionality of duplicates merging.
 

v01d_08

Member
Modder
Jan 2, 2018
233
304
Hi, I am translating DMD and this problem has gone wrong?
Hello, Azrael666. Does the directory in "game/tl" folder is named "Spanish" (with capital 'S') ?

Can you please provide more information? What did you do, and what is wrong?
 

fuser

Newbie
Jul 19, 2017
28
47
Is there a way to work with this tool with unfinished and regularly updated games without the need to start translation anew every time there is an update for the game?
 

v01d_08

Member
Modder
Jan 2, 2018
233
304
Is there a way to work with this tool with unfinished and regularly updated games without the need to start translation anew every time there is an update for the game?
Hello, the tool just grabs untranslated strings from game, translates them and exports back. The creation of translations itself is RenPy feature.
In other words, every time the game updates, you have to update your translations, using RenPy engine. This is how RenPy translation feature works. And then just grab new strings using this tool.
 

JerryC

Member
Mar 5, 2019
106
164
Hey, I was thinking about translating Acting Lessons in French, stumbled on your post... Will probably give it a try in the coming days, will keep you updated about how it goes
 
  • Like
Reactions: v01d_08

v01d_08

Member
Modder
Jan 2, 2018
233
304
New version 0.05

Implemented settings, so you don't need to copy/paste your folder path and API keys every time. Now when you press the button to generate, export, or translate, the tool saves text fields values to file Settings.xml, located near the executable. And every time you start the tool, it loads previus values from settings.
 

Edudu19

New Member
Jun 30, 2017
4
0
Hi, when I translate the game at the time of export always of the error of this type:
111.jpg
For the program to be able to export without these errors I have to modify the file manually by removing all # type this:
2222.jpg
But the way I remove it takes a long time because I have to remove one by one. And there is a lot
3333.jpg
Do you have any way to do this automatically? I need help pls.

I used google translator to write this sorry.
 

v01d_08

Member
Modder
Jan 2, 2018
233
304
Edudu19, thanks for you comment, this was a bug. I've fixed it, please redownload the 0.05 version.

Also I have bad news about DeepL - I found out that , so it would not be implemented. So I will start to implement google API.
 

v01d_08

Member
Modder
Jan 2, 2018
233
304
Hi all, I have good and bad news again.
The good one - I've integrated google API, so now you will be able to choose between Yandex and Google when performing online translation.
Now the bad one - To use Google cloud API, you have to provide billing credentials (credit card number) for your Google account, to prove you are not a robot. More info:
1.3 The Free Trial starts when Customer creates a billing account in the Google Cloud Console (“Free Trial Start Date”) and ends on the earlier of (i) the date that Customer’s fees for usage exceeds $300 or (ii) 12 months from the Free Trial Start Date.
Key facts:
1. Google promises that no money will be charged without your permission after trial period ends.
2. They put to your account 300 free bucks.
3. Google allows to translate 500k characters daily, so probably you would never spend even 1 dollar with this tool.
4. Also the tool doesn't have any access to your personal or billing information via API, this is guarented by Google.

Now I am finishing integration, and than will start working on documentation, because creating Google cloud account can be quite challenging for some users. So on next week a new version of tool is coming.
 

Kalros6000

Newbie
Aug 8, 2018
18
12
ie 12 months then what it costs, I may as well take DeepL

only goes with credit card, no prepaid card but thanks

maybe you can set up DeepL additionally, for customers
e pay there
 

leproso0413

Well-Known Member
May 26, 2017
1,337
316

Hi guys, I've created a tool for Windows, that helps to tranlste RenPy games, called TranslateRenPy.
It will help you to change language in your RenPy game. Currently it can grab all untranslated dialogues from the game to one file, so you can more easily translate it manually, or you can translate it with online translator (using this tool and online API), and then export all translated dialogues back into the game. Tnen just add several lines of code to create a custom menu, and you will be able to change language in your RenPy game.

Generate RenPy translations

At first, let me point that the tool works only with dialogues. The , which is used in some visual novels, is currently not supported. But it is really rare case, so you probably would not need it.

Now let's start. To work with translations, I assume that you have the RenPy engine installed. If not, go to and download the latest version. Then copy your RenPy game to the folder with RenPy sdk, so it looks like on screen below.

View attachment 194945

Then download , press 9 and wait untill all is extracted. After all done, go to the directory with you game, navigate to 'game' folder, and remove all files starting with 'UnRen'.
Now execute RenPy engine from sdk folder, select your project and press Generate Translations. Type your language name and select 'Generate empty strings'. Press Generate Translations, like on screen below. Navigate to YouGameFolder\game\tl, and there you should see a folder, which name you typed when generation translations on previous step.

View attachment 194948

Grabbing dialogues and manual translation

After you are done, execute this tool from any place. Copy global path of your folder with translations, for example C:\renpy-7.1.3-sdk\Milfy_City-0.5c-pc\game\tl\russian into the tool. Press 'Generate translations file', and if you done everywhing correct, the file 'translations.txt' will be generated near the executable of this tool. Open it, and you will see lines like this:

# scripts\beach\Beach_Event\MLR3_beach_cliff.rpy #6
# Mom "Have you ever been cliff jumping before?"
Mom ""

The first line is used by the tool, it should not be changed. The second line is original dialogue, and the third is empty translation. You should type the text between two double quotes. This 3 lines should not be separated by empty lines, it is required for a stable work of this tool.

After you done manual translation, you may want to import dialogues back into the game. Save the changes in translations.txt, and press the button 'Export dialogues from translation file'. The tool will export all non-empty translated dialogues back to the game, and remove them from the file.

Online translation

The online translation is currently performed only via Yandex API (Yandex is russian media company that uses neural networks for their translator, like Google does). To use it, you have to create the Yandex account and register as developer first. Go to , register an account and create a new API key. Then copy this key and paste it to a proper field in this tool. Specify the language, for example to translate from English to Russian the string should be 'en-ru'. To see what language string you need, go to translate.yandex.com website, select your languages and check the url in your browser, you'll see something like 'lang=en-ru', so en-ru is what you are looking for.

Then just press 'Translate using Yandex' button in this tool, and wait. Please note, that Yandex API does not allow to translate more than 1 million symbols per day, also each request can be only 10 kBytes, so the tool has to perform dozens of requests, if you have a lot of text. Also sometimes Yandex restrict too many requests from one IP, so if this happens, the tool will give you a notification that it failed to translate something, just try again in a minute, and it will complete its work.

After 'completed' message appear, check the file translations.txt (located near the tool's executable), it should have all lines translated. Pay attention to 'Total dialogues' and 'Dialogues translated' labels to make sure there were no issues during translation. If all dialogues are not translated, then some errors occurred during API requests, just click 'Translate' button again, and the Tool will complete with remaining dialogues. After you are done, export dialogues back to game by pressing the 'Export dialogues' button. Now you have all dialogues translated and located in YourRenPyGame\game\tl\yourlang directory.
If any errors occur, the tool will show you the line number in translations.txt file and a short description of this error.

Modifying the game preferences

After all done, we need to make possible for user to change translation using RenPy change language feature. Go to the directory with you game, navigate to 'game' folder, and open file screens.rpy in your text editor. Find the line
if renpy.variant("pc")
it should be located in 'preferences' section. If there is no such line, find 'hbox' or 'vbox' or 'frame' and insert next code after it, starting from new line (please note, that the number of spaces is important! see screen below. Tab symbols are not allowed by RenPy, use only spaces. Also change 'Russian' to your language, and the second 'russian' exactly to the name of folder with your translations, case sensitive). But keep in mind, that screens.rpy is unique in every game, so there is no exact scenario, how to modify it. You are responsible for this on your own. The main idea is to insert a block, similar to existing, and add 2 textbuttons.

Python:
vbox:
    style_prefix "pref"
    label _("Language")
    textbutton "English" action Language(None)
    textbutton "Russian" action Language("russian")
or if your preferences screen contains frames:
Python:
frame:
    style_prefix "pref" #or any other style depending on your code
    has vbox: #if your frame is inside vbox section
        xfill True #if your frame is inside vbox section
    label _("Language")
    textbutton "English" action Language(None)
    textbutton "Russian" action Language("russian")
View attachment 221326 View attachment 221328

Now start the game (either from game executable or from RenPy engine 'Launch Project'). Click on Preferences (or similar label) in main menu of the game, and you will see the Language section on Preferences tab. So you are able to change the language now (if the label with the name of your language is disabled, probably the name of the folder with translations and the string with lang name in screens.rpy do not match). If you changed the language - congratulations.
You can give the folder with translations and a file screens.rpy to any person who has the same version of the game, and it will work like a charm.
Of course the machine translation is not the same as human, but sometimes it is much better than nothing.

This tool requires to be installed, if you failed to start this tool on your PC, install it.
. The tool is packed with .net packer, so several engines consider it as unsafe with low score, please don't pay attention.

The tool is still in development phase, so if you found any issues - please report them here with Log.txt file, which is located near executable.

If you used this tool to translate a game - please leave a comment in this thread about your experience.

You don't have permission to view the spoiler content. Log in or register now.

You don't have permission to view the spoiler content. Log in or register now.
Your tool is great, I'm safa a band with renpy games and thank you, highly recommended and I would love to continue updating it having other translators, that would be more than great. I congratulate you for this tool, the best I found far!
 
  • Like
Reactions: v01d_08

leproso0413

Well-Known Member
May 26, 2017
1,337
316
Hi guys, thanks for your comments, I appreciate that!
I'm sorry I didn't post the Google Translator version, I don't get my hands on it, it's still unfinished.
It's worth waiting for. The truth is how you got me with this tool, to be able to play any Renpy game in Spanish. You're a genius and it's the only tool I could get the games translated this way, simply beautiful. I hope later on, besides the google translator, you add other ones. I'm also very interested in Deepl which is very good too. Greetings and thanks for this...
 
5.00 star(s) 4 Votes