What's new

Translation tool for RPG Maker XP/VX/VX Ace


Yugifan3

Tentacle God
Joined
Oct 23, 2013
Messages
1,968
Reputation score
1,057
Re: Translation tool for RPG Maker XP/VX/VX Ace

So, say i have json in C:\Ruby
And the data i wanna update
C:\Ruby\Data
So i type :
ruby rmvx_translator.rb --translate=CommonEvents.rvdata --dest=c:\ruby\Data

Edit:
 
Last edited:

candyfloss

Sex Demon
Joined
Oct 13, 2013
Messages
303
Reputation score
446
Re: Translation tool for RPG Maker XP/VX/VX Ace

Man, me and yugifan have been trying to make it work for hours! :mad:

Anyway, what we did was to convert the rvdata file to a JSON file, and then straight away replace the words that I want to translate, aka changing all 【紫陽花】 to 【Ajisai】.

For example:

"json_class": "RPG::EventCommand",
"type": "Show Text",
"parameters": {
"json_class": "TranslatableArray",
"original ": [
"【紫陽花】",
"お買い上げ、ありがとうございましゅ❤ ご主人様…❤"

to

"json_class": "RPG::EventCommand",
"type": "Show Text",
"parameters": {
"json_class": "TranslatableArray",
"original ": [
"【Ajisai】",
"お買い上げ、ありがとうございましゅ❤ ご主人様…❤"

Basically, because the name "Ajisai" is everywhere in the file, I want to replace every 【紫陽花】 to 【Ajisai】 and convert the JSON file back to rvdata.

But as it turns out, all the changes were undone even though I saved the file as it was converted back to the rvdata type file. :confused:
 

kvier

Demon Girl Master
Joined
Mar 22, 2012
Messages
315
Reputation score
49
Re: Translation tool for RPG Maker XP/VX/VX Ace

You need to leave the "original" alone and put your replacement text in the "translation" fields.
 

Yugifan3

Tentacle God
Joined
Oct 23, 2013
Messages
1,968
Reputation score
1,057
Re: Translation tool for RPG Maker XP/VX/VX Ace

Well, wanted just to translate the characters name. So, figured could just use Notepad++ to find and replace all. But, would take Alot of time if had to
copy paste it 976 times. X_x
 

Libellule

Cthulhu
Joined
Oct 21, 2013
Messages
379
Reputation score
273
Re: Translation tool for RPG Maker XP/VX/VX Ace

Well, wanted just to translate the characters name. So, figured could just use Notepad++ to find and replace all. But, would take Alot of time if had to
copy paste it 976 times. X_x
You can easily make that with 2 line of regEX, one to auto copy/paste all original to translated, and then one to replace all name just in the translated section

i make it often on the .txt that we get from habisai rpg trans, that the same thing here, just the need to create the regex

so if you alway need (seeing the post was 1 week ago :p), PM me, i surely can help
 

kvier

Demon Girl Master
Joined
Mar 22, 2012
Messages
315
Reputation score
49
Re: Translation tool for RPG Maker XP/VX/VX Ace

It's something that'd be easy to do with any programming language that has a JSON parser.

Load original JSON, find each node with both "original " and "translation" children, apply the regex to the "original " node and save it in the "translation" node.

Only funny business is that the "original " and "translation" children can be either strings or arrays of strings.

I had started building something in javascript (so that you could just do everything in a web browser) but got sick of it.
 

candyfloss

Sex Demon
Joined
Oct 13, 2013
Messages
303
Reputation score
446
Re: Translation tool for RPG Maker XP/VX/VX Ace

Oh well, I already manually copy-and-paste over the names. Yup, ctrl + v hundreds of times. But I'm glad there's a solution. I guess I can PM Libellule next time if I need help! :p
 

candyfloss

Sex Demon
Joined
Oct 13, 2013
Messages
303
Reputation score
446
Re: Translation tool for RPG Maker XP/VX/VX Ace

Hellooo.

I would like to request for a bit of help again here. I'm making a translation patch for a game and I came across events that has text embedded in separated RPGVX data files. I'm using RPG Maker editor to unpack and make the translation patch, but it is unable to access to the files with its database.

The screenshot below shows how the editor use the separated RPGVX data file with a script.



As you can see, RPG Maker editor simply obey the script and access the rvdata file in the game. However, I can't make edits to the text this way.

Does anybody here has a solution to this? I'm thinking that the RPGVX Data files could be converted to JSON files using ruby so it can be edited with notepad++ and converted back to RPGVX Data after translating it, but I couldn't get my ruby to work for me. :(
 

slicer.xy

New member
Joined
May 20, 2018
Messages
2
Reputation score
0
Hello Perost,

Are you still working on your translation tool? I tried several tools that could patch a game and while your tool was not the easiest tool to automate with, I really liked how thorough it was at finding text to translate. However, while using your tool, I discovered a bug. I have attached an original file that becomes broken after trying to apply a translation using your tool.

If I use your tool's dump command and then translate command without changing the created JSON file (my understanding and that there should be no change to the uploaded file under such steps) the file will shrink from 1525KB to 1365KB. When putting the newly patched file into the game, text in certain scenes are missing. If I replace that one patched file with the original unpatched file, the original Japanese text will appear where it is supposed to.

If you have the time, I would really appreciate it if you could fix the translation tool. I understand If you do not have the time, just wanted to bring it up in case it could happen.
 

Attachments

JustLurksHere

Jungle Girl
Joined
Oct 28, 2016
Messages
558
Reputation score
45
@slicer.xy: I'm not the author of this thing, but I suspect either you're doing something wrong or comparing things wrong.
For the record: couldn't reproduce the problem with your attached file.

To rule some things out:
- what are the exact commands you're using in your tests ?
- which version of ruby interpreter are you using ?

slicer.xy said:
my understanding and that there should be no change to the uploaded file under such steps
Technically yes (though things might get a bit sketchy with scripts dump), but there might be some corner cases.
 

slicer.xy

New member
Joined
May 20, 2018
Messages
2
Reputation score
0
The version of ruby I am using is:
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]

I am using this command in order to dump the json file:
ruby rmvxace_translator.rb --dump=*.rvdata2

This is the command I am using in order to apply the json file on to the rvdata2:
ruby rmvxace_translator.rb --translate=*.rvdata2 --dump=E:\Saved


On a side note, the patch fails to be applied where I specify it and is instead applied to the folder in which the rvdata2 and json file are located, overwriting the rvdata2 file that I am using. Well, that is what backups are for.

Thank you for answering my post.



@slicer.xy: I'm not the author of this thing, but I suspect either you're doing something wrong or comparing things wrong.
For the record: couldn't reproduce the problem with your attached file.

To rule some things out:
- what are the exact commands you're using in your tests ?
- which version of ruby interpreter are you using ?


Technically yes (though things might get a bit sketchy with scripts dump), but there might be some corner cases.
 

JustLurksHere

Jungle Girl
Joined
Oct 28, 2016
Messages
558
Reputation score
45
...Hmm...

For one, '--translate=*.rvdata2 --dump=E:\Saved' doesn't work pretty much by design: quick check of ruby standard library tells that Pathname.glob(pattern) is basically Dir.glob(pattern) - it could be passed a base path, but the current code doesn't, so it works in the current dir. Also, while it's just a guess on my part, running it that way seems at least potentially racy.

Now, as for the real problem:...I'm still on ruby 2.6 and in ruby backward incompatible changes can happen, though they rarely ever affect marshaled data, so odd but potentially possible. You could try running it as 'ruby -w', but given that it works at all, I doubt anything interesting would pop up.

Try it this way:

Code:
ruby -w rmvxace_translator.rb --dump=CommonEvents.rvdata2
ruby -w rmvxace_translator.rb --translate=CommonEvents.rvdata2
For me, while it doesn't result in identical files, the size doesn't change, so I just assume it's due to reordering of data.
Depending on the context, sometimes better comparison would be to redump the translated file and compare the dumped json.
 

zths

Active member
Joined
Nov 21, 2020
Messages
239
Reputation score
160
The version of ruby I am using is:
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]

I am using this command in order to dump the json file:
ruby rmvxace_translator.rb --dump=*.rvdata2

This is the command I am using in order to apply the json file on to the rvdata2:
ruby rmvxace_translator.rb --translate=*.rvdata2 --dump=E:\Saved


On a side note, the patch fails to be applied where I specify it and is instead applied to the folder in which the rvdata2 and json file are located, overwriting the rvdata2 file that I am using. Well, that is what backups are for.

Thank you for answering my post.
If I'm right, the Ruby version is !!!Very important!!!

The Ruby marshal is not same between versions.
Means you best use the same version as game using, otherwise you may encountered problem.
 

JustLurksHere

Jungle Girl
Joined
Oct 28, 2016
Messages
558
Reputation score
45
@zths: ...actually, since late ruby 1.9 (perhaps even 1.8), the marshal data format had been stable. However given the accumulation of incompatible code changes and that Fixnum/Bignum merge back in 2.4, there's a possibility that parts of the data may be represented differently upon remarshaling, so something might have happened in ruby 3.0.

There are some significant changes between XP/VX and VXAce, due to only the later being 1.9 (both of the other being 1.8) (in 1.8 strings didn't have an encoding field, so they aren't dumped as utf8 text they are when you dump them to yaml, at least without a bit of extra work), but all three seem to use marshal 4.8 format.
 
Top