What's new

[TOOL] Machine Translator - work for RPGMakerTrans, wolftrans


prao179

Member
Joined
May 8, 2018
Messages
92
Reputation score
62
About this tool, You need RPGMakerTrans to patch game and it will translates Japanese into Eng text for you and you can use it for re-translate or apply patch to your game.

Also work on wolftrans.

For example:

> BEGIN STRING
んー…
いいや、このまま帰しちゃお
> CONTEXT: Commonevents/16/37/Dialogue < UNTRANSLATED
> CONTEXT: Commonevents/16/53/Dialogue < UNTRANSLATED

> END STRING

After translate, it will be appeared like this

> BEGIN STRING
んー…
いいや、このまま帰しちゃお
> CONTEXT: Commonevents/16/37/Dialogue
> CONTEXT: Commonevents/16/53/Dialogue
Hmm…
No、Let's go home as it is
> END STRING

Link video tutorial:

Features:
-Translate whole sentence: clear meaning
-Auto line-down: fit text to screen
-Easy skip function: Control what to translate (Avoid errors)
-Multi-API: unlimited translate
-Multi-Threading: Translate fastest as possible

Need to know:
Dont delete or replace your translation_en.json, use the old one u have. Only download it if yours is broken, or you dont have one.


All information in manual and translator.
If any error comes up. Contact me for better code.
Thanks

Download:
 
Last edited:
OP
P

prao179

Member
Joined
May 8, 2018
Messages
92
Reputation score
62
17/6/2018: Updated new version "Machine Translator - work for RPGMakerTrans.zip" download at first post.
 
OP
P

prao179

Member
Joined
May 8, 2018
Messages
92
Reputation score
62
Edit on 6/18/2018: Fix single quote error when apply patch to game. Script can be translated with 80% success, 30% game will run normal after translated.

Download latest version on first post.
 

ColtM1911

Jungle Girl
Joined
Aug 31, 2013
Messages
41
Reputation score
42
Made something like this just a few days ago in C++.
But too quick-hackish to show to others :)

Things to consider:
1.) Preservation of RPGMaker escape sequences (like //N[1], //G and many others). In Ruby scripts amount of escape slashes effectively doubles, so we end with "////N[1]", "////G" and so on.
Google translator splits these in multiple parts, and some time screws them up completely. I managed to more-or-less get around it by using simple post-processing with regexps like "(?:/\s*)+([A-Z])\[(\d+)\]".

2,) Translation of common event handles. These should be translated exactly the same way everywhere in game logic and Ruby scripts or not at all. Still too many possibilities to eff everything up. Maybe resulting mess can be effectively debugged and scripts/events in patched game modified manually, but i'm not sure.

3.) Effing 'lazy development practices', as Habisain put it, that make robust automatic translation virtually impossible for most interesting games.

Maybe situation can be improved if we somehow modify RPGMaker Trans itself to make it a little smarter (to filter japanese code tags from human-readable text).
 
OP
P

prao179

Member
Joined
May 8, 2018
Messages
92
Reputation score
62
Made something like this just a few days ago in C++.
But too quick-hackish to show to others :)

Things to consider:
1.) Preservation of RPGMaker escape sequences (like //N[1], //G and many others). In Ruby scripts amount of escape slashes effectively doubles, so we end with "////N[1]", "////G" and so on.
Google translator splits these in multiple parts, and some time screws them up completely. I managed to more-or-less get around it by using simple post-processing with regexps like "(?:/\s*)+([A-Z])\[(\d+)\]".

2,) Translation of common event handles. These should be translated exactly the same way everywhere in game logic and Ruby scripts or not at all. Still too many possibilities to eff everything up. Maybe resulting mess can be effectively debugged and scripts/events in patched game modified manually, but i'm not sure.

3.) Effing 'lazy development practices', as Habisain put it, that make robust automatic translation virtually impossible for most interesting games.

Maybe situation can be improved if we somehow modify RPGMaker Trans itself to make it a little smarter (to filter japanese code tags from human-readable text).
Thanks you for your reply, I appreciate that.

1.I'm code on Ruby because RPG Maker Translator was code on Ruby too. Beside I'm not good at API or something about "Internet code" and high-level code :p so I wanna re-use their code.
As U said, preserve escape slashes and others thing was so hard. I spent few hours to debug only "single quote" but not meet the others yet, b'cause my translator very simple Exactly like google.
Ex: "Jap SlashStuff Jap" should be translate to Meaning1. My translator will do this "MeaningJap Stuff MeaningJap". Stuff here can be "\n" - newline or game_variable. About some thing like "\n", just delete it, we'll add it for translated stuffs later. game_variable, it just a number, Replace them by some number, send to google, replace back, Im still on progress with this. If u wanna say it maybe not number, just do it like number method:).

2.If u wanna say about my effort to translate common event by "RPG Maker Translator". Translate from Json is 100% success checked by manual, Not meet any problem, but convert back to rvdata2 by itself. Convert sucess but it lost so much of Script, cant fix them if not have time.

3.This tool is aim to some games u like but there are no translation for it yet so u can do it ur self as partial or just for understand the story. Maybe it will support u a lot when u attend to translate game by manual.

Im still new with this and still a college student. Start coding on Ruby few day ago and learning C++. Doing this because wanna improve my skill and play game:ROFLMAO::ROFLMAO: which RPG Maker Translator have problems when translate it.
 

ColtM1911

Jungle Girl
Joined
Aug 31, 2013
Messages
41
Reputation score
42
Hello again!

I actually think Ruby is much better suited for this task than C++. I used it (with awesome Qt framework) just because I know it better than anything else and don't like dynamically-typed languages. You should totally use whatever works best for you, and a lot of people use Python and Ruby for internet-related thing and text processing.

I spent few hours to debug only "single quote"
Yup, I forgot to mention escaping special symbols in translator's output. Like double quotes inside strings.

game_variable, it just a number, Replace them by some number, send to google, replace back, Im still on progress with this. If u wanna say it maybe not number, just do it like number method:).
Yes! Thought about something like this. This should work.
Maybe also enclose numbers in some additional symbols, like "Some text <1>, some text some more text <2> ...", to prevent Translator pronouncing numbers. Technique needs some experimenting.

If u wanna say about my effort to translate common event by "RPG Maker Translator". Translate from Json is 100% success checked by manual, Not meet any problem, but convert back to rvdata2 by itself. Convert sucess but it lost so much of Script, cant fix them if not have time.
Sorry, I failed to parse this message of your fully :)
By my observations, translation of dialogues on maps works pretty well. Scripts obviously need manual editing. Not sure about CommonEvents. As far as I understand RPGMakerTrans don't extract event names (handles) on purpose, yet I believe somehow I produced a crash with my automatic translation.

I tried to translate Lilia's Livelihood, and from second try it worked reasonably well. I even played for 20 minutes or so, until stumbled on a crash in a dialogue with another character, caused by classical NPE. I'm too lazy to dive in for a full-scale debugging, and not even sure if there were any scripts involved.
Put this little project aside for now.

3.This tool is aim to some games u like but there are no translation for it yet so u can do it ur self as partial or just for understand the story. Maybe it will support u a lot when u attend to translate game by manual.
I just don't like reading translated text from separate window. And the fact that my PC constantly sends suspicious lines of text back and forth over the net during gameplay :)
We should have better way to play untranslated games. And, because RPGMakerTrans already exists (thanks to Habisain's efforts) task of half-automating machine translations seemed reasonably simple. But there are nuances, of course...

I don't believe that no one yet tried to make a tool like this. Lack of discussion on this topic is surprising.
Anyway, I wish you best of luck!
 
OP
P

prao179

Member
Joined
May 8, 2018
Messages
92
Reputation score
62
We should have better way to play untranslated games. And, because RPGMakerTrans already exists (thanks to Habisain's efforts) task of half-automating machine translations seemed reasonably simple. But there are nuances, of course...

I don't believe that no one yet tried to make a tool like this. Lack of discussion on this topic is surprising.
Anyway, I wish you best of luck!
Yeah, thanks you for the informations, I will do my best.
Hope your news about your application too.
 

ColtM1911

Jungle Girl
Joined
Aug 31, 2013
Messages
41
Reputation score
42
I experimented a bit today and made an amazing discovery!

Null pointer exception I mentioned earlier (in standard VX Ace script Window_Message, line 347 to be precise) is caused by trailing backslash in dialogue text.
This is really lame on the part of Enterbrain. Also one of the reasons why I don't like dynamically typed languages: they create an environment where errors like this have chance to occur.
You can easily reproduce this crash by adding an "Show Text" to any event with a string like "Muhahahaha! \ ".

But it also mean that maybe I can still manage to finish my translation! :)

Your workaround with numbers should work.
Also should add more rigid postprocessing, because apparently RPGMaker crashes on ill-formed strings.
 
OP
P

prao179

Member
Joined
May 8, 2018
Messages
92
Reputation score
62
Null pointer exception I mentioned earlier (in standard VX Ace script Window_Message, line 347 to be precise) is caused by trailing backslash in dialogue text.
This is really lame on the part of Enterbrain. Also one of the reasons why I don't like dynamically typed languages: they create an environment where errors like this have chance to occur.
You can easily reproduce this crash by adding an "Show Text" to any event with a string like "Muhahahaha! \ ".
That's useful informations. I'll add it to debug string.

Im working with "We Have No Rice! ~Magical Farming Survival RPG~". This game is controling some NPCs by comments. It meant U put some comments in it, then scripts will take the text in comment and run it. The problem is RPGMaker is not show the comments or scripts of Events. So cant translate it to match it with the text in Scripts Data. We should untranslate the Scripts with Japanese text 'til RPGMakerTrans can show the comments of Events for us.

Maybe, in this summer, I would change my script into C++. That would easier to debug string.
 

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Lol I gave SHRIFT to my own custom translator and posted a thread then saw this. How do you make the translation API work?
 

ColtM1911

Jungle Girl
Joined
Aug 31, 2013
Messages
41
Reputation score
42
How do you make the translation API work?
I just googled "google translate free api" and found

You just need to send a request to this URL:
Code:
https://translate.googleapis.com/translate_a/single?client=gtx&sl=<sourceLang>&tl=<targetLang>&dt=t&q=<encoded source text>
And then process returned JSON.
You can try this in your browser: !
 

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Nice. I personally use Internet Explorer automation to send a maximum of 500 character every 5 sec and retrieve the html document. It hasn't triggered any security check so far. I want to safely improve the perf so I must know what to expect.
How much data can you process with your method?
 

ColtM1911

Jungle Girl
Joined
Aug 31, 2013
Messages
41
Reputation score
42
Hello again!

Hey, can you do a video tutorial from the first step to the last step
and thanks in advance
At first I thought you were asking a tutorial on how to use this "free Google Translate API" and started writing a lengthy response, and then it dawned upon me that you probably asked prao179 how to use his tool. Sorry.

How much data can you process with your method?
All of it. Really, I didn't have any problem with Goolge blocking my requests.
My tool parses RPGMakerTrans patch files and collects every mentioned text "string" (they can be quite large). Then it prepares a network request for each string and sends them in parallel* asynchronously.
In the game I was translating there are near 7000 distinct text strings, and total translation time was around one minute.

* I used a Qt class called QNetworkManager that automatically puts requests in queue and processes only a handful of them in parallel at any given time.
 

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Your code looks short and efficient.... exactly what my code isn't, for now hopefully, but I'll have to rewrite almost everything and convert it in another language when I'm done increasing the complexity of my algorithm.
Good luck with your project anyway.
 
OP
P

prao179

Member
Joined
May 8, 2018
Messages
92
Reputation score
62
Hey, can you do a video tutorial from the first step to the last step
and thanks in advance
Right now, I have some thing personal to do. Not have time yet.
But i would do it for you soon
 
OP
P

prao179

Member
Joined
May 8, 2018
Messages
92
Reputation score
62
Your code looks short and efficient.... exactly what my code isn't, for now hopefully, but I'll have to rewrite almost everything and convert it in another language when I'm done increasing the complexity of my algorithm.
Good luck with your project anyway.
Thanks, Hope news from your too
 
Top