Tool RenPy Translation tool

5.00 star(s) 4 Votes

Lucas979

Newbie
Oct 13, 2018
31
33
Hey, folks, I have some good news. I've played around with an offline translation engine called Argostranslate (thanks to
kurakorte for the link), and finally I've managed to get it work on my laptop. This was not easy, and it requires tons of actions to be done, but it is offline and free, and covers most of popular languages.
I haven't write any code yet for the tool, just installed everything and got it work offline in my browser.
Now the bad news - to get it work on Windows, you need to install the software called Docker. And here is a requirement list for it:
  • Minimum Windows 10 64-bit: Home or Pro 2004 (build 19041) or higher, or Enterprise or Education 1909 (build 18363) or higher. (To check your Windows version and build number, press Windows logo key + R, type winver, select OK)
  • Minimum 4 GB RAM
  • 10 GB of free disk space
  • Processor with Hyper-V support. (to check if you have this feature, press Windows logo key + R, type cmd, select OK. Type Systeminfo.exe, press enter. Scroll down to 'Hyper-V Requirements'. It should that all is OK, or a hypervisor has been detected.).
  • BIOS-level hardware virtualization support must be enabled in the BIOS settings. (See how to check it. If it is turned off, then google how to turn in on for your PC model or laptop model).
Please let me know if your system meets the requirements, so I can know if it worth implementing - put a like under this post if yes, and a sad face, if no. If this will not work for most of people, there is no sense in this.
is this update still up?
 
  • Like
Reactions: oldschool34500

v01d_08

Member
Modder
Jan 2, 2018
233
304
Unfortunately when I started to deal with it closely, it turned out that Libretranslate have bugs and does not translate correctly in case of bulck translation. This was a big dissapointment because I wasted a lot of time to get it work on my PC.
So I want to add new way of translation using google docs, but I get tierd on work durring day, and just does not have inspiration to do it in the evening. So I have plans for improvements, but don't know when I'll be able to implement it.
 
  • Like
Reactions: Lucas979

Lucas979

Newbie
Oct 13, 2018
31
33
Unfortunately when I started to deal with it closely, it turned out that Libretranslate have bugs and does not translate correctly in case of bulck translation. This was a big dissapointment because I wasted a lot of time to get it work on my PC.
So I want to add new way of translation using google docs, but I get tierd on work durring day, and just does not have inspiration to do it in the evening. So I have plans for improvements, but don't know when I'll be able to implement it.
I think the google documents thing would work, hopefully it can, qwiklabs is no longer a reliable solution... since when you do a translation of a single VN they already eliminate your account...
 

lfxyf001

Member
Mar 15, 2021
115
54
Unfortunately when I started to deal with it closely, it turned out that Libretranslate have bugs and does not translate correctly in case of bulck translation. This was a big dissapointment because I wasted a lot of time to get it work on my PC.
So I want to add new way of translation using google docs, but I get tierd on work durring day, and just does not have inspiration to do it in the evening. So I have plans for improvements, but don't know when I'll be able to implement it.
Can't the tool simplify the translation, such as translating the text export form, translate the good in the form of import can be used, and it seems to be translated to add the corresponding font to use.
 

v01d_08

Member
Modder
Jan 2, 2018
233
304
Hello, I'm currently suspend all my activity on this forum, because Russia invaded my country, killing thousands of civilians and destroying cities with tanks and rockets. I don't know what will be tomorrow.
 
Jun 2, 2020
353
467
Hello, I'm currently suspend all my activity on this forum, because Russia invaded my country, killing thousands of civilians and destroying cities with tanks and rockets. I don't know what will be tomorrow.
Ah! I've seen other videos... (on youtube, among others), of people doing their shopping quietly. The only people targeted are the military who are fighting for a corrupt government, and this same government. It's not good to alter reality.
 

mtmes

Member
Mar 16, 2019
150
98
When I want to prepare a translation with renpy sdk, I get the following error message shortly after pressing Generate Translation (tried with W10 and W11). I hope you can help me.


Code:
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00library.rpy", line 28, in script call
    call _errorhandling
  File "renpy/common/00library.rpy", line 28, in script call
    call _errorhandling
  File "game/saveload.rpy", line 45, in save_per_label
    store.store_state = renpy.game.log.freeze()
AttributeError: 'NoneType' object has no attribute 'stores'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/bootstrap.py", line 331, in bootstrap
    renpy.main.main()
  File "renpy/main.py", line 560, in main
    renpy.game.context().run(node)
  File "renpy/common/00library.rpy", line 28, in script call
    call _errorhandling
  File "renpy/common/_errorhandling.rpym", line 46, in script
    init label _errorhandling:
  File "renpy/common/00library.rpy", line 28, in script call
    call _errorhandling
  File "renpy/common/_errorhandling.rpym", line 46, in script
    init label _errorhandling:
  File "renpy/ast.py", line 879, in execute
    renpy.config.label_callback(self.name, renpy.game.context().last_abnormal)
  File "game/saveload.rpy", line 45, in save_per_label
    store.store_state = renpy.game.log.freeze()
  File "renpy/python.py", line 2142, in freeze
    self.complete(False)
  File "renpy/python.py", line 1726, in complete
    self.current.stores[name], self.current.delta_ebc[name] = sd.get_changes(begin)
AttributeError: 'NoneType' object has no attribute 'stores'

Windows-10-10.0.18362
Ren'Py 7.4.11.2266
 
  • Like
Reactions: rizzfest

renato186a

Active Member
Sep 6, 2020
657
691
View attachment 1094350
Latest version: Translate RenPy 0.08


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. First, we need to setup everything, it may take you about 20 min, but this required to do only for the first time.
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 version 0.9, press 1 (Extract RPA) and wait untill all is extracted, then press 1 to return to menu, and then 2 (Decompile rpyc). 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

Remark: If you want to do online translation, you can jump to next step "Online 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 performed via Google. To use Google Translation API you must create a Google Cloud account and add you credit card to activate the account. Also there is a complicated alternative way of creating an account, if, for some reason, you failed to add a credit card. For detailed instructions see the file Translate.API.pdf attathed to this thread or near the tool's executable.

So once you setup your account and finished the translation with the tool, a '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. It can take some time, in case you don't have SSD disk, be patient.
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.
(If the way below is too difficult to you, and you failed it, or you don't understand how to do it - see Q/A section, there is an alternative way.)
Go to the directory with you game, navigate to 'game' folder, and open file screens.rpy in your text editor (sometimes this file located in 'game/scripts' folder). Find the text
use game_menu(_("Preferences")
After it, try to find
if renpy.variant("pc")
it should be located in that '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: #add if your frame is inside vbox section
        xfill True #add 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

Failed to change game preferences? Don't forget about Q/A section in this post, there is an alternative way.

Now start the game (the best way to click 'Launch Project' from RenPy engine, so if there are any errors in translation files, the engine will show them to you). In the game 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 RenPy Translation tool requires runtime libraries to be installed, if you failed to start this tool on your PC, install it.
. The program is packed with .net packer, so several engines consider it as unsafe with low score, please don't pay attention.
If you found any issues - please report them here with Log.txt file, which is located near executable.

For those, who want to better understand how RenPy translation process works - I recommend to read this tutorial by member moskyx: Translating Ren'Py games: a comprehensive guide.

If you used this tool to translate a game - please leave a comment about your experience in this thread.
Created a post about translation at F95zone? Leave a link to this thread, so other people know it exists.

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.
You don't have permission to view the spoiler content. Log in or register now.

does anyone know why this tool.cannot translate all games.only games with normal visual novel pattern
 

Arkantoos

New Member
Aug 26, 2020
3
0
every time i try to generate the file the application displays this error window. can anybody help me?
 

zili15

New Member
Jul 7, 2017
5
1
Hello All! Who can tell me how to translate with square brackets to exclude their translation in context. Used a bunch of variants to exclude square brackets via expression slider, but haven't found anything like in renpy via SDK translation.
Example:
You and [Father.Name] are [SonT] and [FatherT]

If I indicate tags with lines OLD and NEW then renpy does not see anything before and after square brackets no reaction to translation. I've read something about expression properties to exclude something I need to put in {}, but this way also no reaction. Who faced with this problem and came to some normal solution, of course I can substitute and replace everything, but I think this is extremely wrong.
 

hungchip

Newbie
Feb 19, 2022
36
11
hi master, can you dev an easy tool auto translate with no Google Cloud Account? I can view your Ads. But, can you add Auto Translate with no Google Account?
 
  • Like
Reactions: furrry2

zWindows

Newbie
May 30, 2019
55
78
So friends, and a simple question, any possibility for me to translate a .RPY query file with some tool?

The reason is that the renpy SDK did not extract the dialog from some of the .rpy in the game folder.

How to get around this, without having to do the whole file manually with

OLD
NEW
 

rizzfest

New Member
Feb 17, 2023
5
4
:( I want to test this software, but it gives me "Translation was stopped because the issue of network" and "Press Enter to exit..." which just freezes up.
 

edem1978

Active Member
Apr 2, 2018
533
146
hello i am new to learning how to translate games now i made a game but every time i want to save i get this error what is it and how can i find this error in which folder is it O
 

frelon71

Active Member
Nov 29, 2018
585
426
hello i am new to learning how to translate games now i made a game but every time i want to save i get this error what is it and how can i find this error in which folder is it O
Hi, I see that there's an ending missing so it doesn't work:

{#file_time}{#weekday}Montag, {#Monat Mai 29 2023, 00:01'.

try it:
{#file_time}{#weekday}Montag, {#Monat Mai 29 2023, 00:01}
 

edem1978

Active Member
Apr 2, 2018
533
146
Hi, I see that there's an ending missing so it doesn't work:

{#file_time}{#weekday}Montag, {#Monat Mai 29 2023, 00:01'.

try it:
{#file_time}{#weekday}Montag, {#Monat Mai 29 2023, 00:01}

thanks but in which folder is it script common or others
this is my coomon file but am i missing the error
 
Last edited:
5.00 star(s) 4 Votes