What's new

[Tool] RPGMaker VX Ace Patcher - Gaijinizer Patchmaker


Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Download link:

v 0.2.5

v 0.2.3
v 0.2.0
v 0.1.2

v 0.1.1
2019/03/05: v0.1.1 bug fix, removed some code as per request
2019/03/08: v0.1.2 bug fix eval, added sample configurations in the Gaijinizer/Eval directory
2019/03/12: v0.2.0 major bug fix, cache empties itself, cached text now encoded, patch syntax slightly changed
2019/04/05: v0.2.3 bug fix, picture translation, better script regex, more sample configs
2019/04/16: v0.2.5 bug fix, more sample configs, mouse script added in plugins, patch with plugins only

I'm sharing a translation tool I've developed as an alternative to RPGMaker Trans.
Like RPGMaker Trans, Gaijinizer Patchmaker generates text files which you can then translate and then use to patch the game.

I tried to keep the syntax very similar and it should be possible to make an add-on to make it compatible with RPGMaker Trans 4.5.
The main differences are that it's written as a RPGMaker VX Ace script, it's entirely customable, and it's way faster (Write ~ 6s, Apply ~ 12s).
Customization enables you, for example to translate comments, notes, and renames (which isn't possible with RPGMT).

To use it just copy/paste the files in the game folders then launch the game.
Make sure your game isn't encrypted (you have a Data folder and the Game.rgss3a archive is renamed or deleted).
You can rename the Game.ini Game_.ini if you also want it translated.
19970

You will be greeted by a User Interface with whatever classy picture you put in Gaijinizer\Background.png.
19973
The menu option "Patch Game" is only enabled if you have a Gaijinizer\Patch folder in which you have put your translated files,
files that you obtained with your hard labor on what you got selecting the "Create Untranslated Files" option.
Be warned there is no fancy progress bar and that the UI will freeze while the script is working.
19972
(elapsed time is bullshit as it used the cache)
Your translated files will be put in Gaijinizer\Game_en and loaded by script magic (aliasing load_data actually) when you restart the game.
You can of course just copy these and overwrite your files to patch the game (less magic and more barbarism).

19975

Now because everything is customizable and can be modded to oblivion I'm only going to give a quick overview of the other implemented features. The rest being yours to discover if you want to go deeper with your translation project.

Before creating a patch you can:
Add inclusive and exclusive filters to sort useless content (text that is not japanese, data that is irrelevant..)
Choose the syntax (and make it compatible with RPG Maker Trans V4.5 if you wish so).
When translating you can:
Add comments (# like with RPGMT)
Add multiple languages
Add Plugins (in designated folder)
And yadayadayada... look in the script. Ask questions if you're lost.

This is the fist version of the tool. I'm using it in one of my projects.
It fits my needs and I'm planning to add features to make the translation easier. I want the translation to be dynamic, I want a little window to popup with the Japanese text, a translation if there's any, and a dialogue box to add a translation. I also want to be able to merge translation projects.

It has three issues for now:

I haven't tested exhaustively (I haven't been using it for as long as, let's say, RPGMT) so there might be some issues.
Edit: I've tested it on 4 games and it works fine on them. This is by no mean what I would call extensive and I'm still sometimes fixing bugs on my 4th iteration. However, I'm satisfied.
This is not extracting scripts regex for translation (because I didn't need it, but RPGMT can so beware if you have to translate things like that: /stuff/)
Edit: It can but it's optional.
This can't rebuild patches yet. Appending files with new content can be done, but the whole feature is still WIP.
Edit: It can but it's mostly untested (I have no use for it for now).
 
Last edited:

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
I encounter this error when I try to create untranslated files with the script:
Code:
Script 'Gaijinizer Patchmaker' line 842: NameError occurred.
undefined local variable or method `position' for Gaijinizer::patchmaker:Module
Tried it out with VX Ace games like RJ224571
 
Last edited:
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Thanks, I'm correcting that.

Edit:
Put this in Gaijinizer/Scripts and tell me if it works.

Ruby:
  def self.script_index_array(script, index_array, raw_data, i, match)
    # #Alias me for clearer contexts
    # Change index_array[0] to change patch file name
    # No need for invert function
    # return nil to exclude
    left = script[1..raw_data[i][1][0]]
    line_number = left.lines.count
    line_position = (line_number == 1) ? position : left.reverse.index("\n")
    return index_array.dup << "#{line_number}:#{line_position}"
  end
Ruby:
  def self.script_index_array(script, index_array, raw_data, i, match)
    # #Alias me for clearer contexts
    # Change index_array[0] to change patch file name
    # No need for invert function
    # return nil to exclude
    left = script[1..raw_data[i][1][0]]
    line_number = left.lines.count
    line_position = (line_number == 1) ? raw_data[i][1][0] : left.reverse.index("\n") # position  -> raw_data[i][1][0]
    return index_array.dup << "#{line_number}:#{line_position}"
  end
(SHAME)

I'll update the download link tomorrow, I had a long day.

Edit2: I'm removing the file, directly use 0.1.1 or after instead/
 
Last edited:

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
Works fine now with the fixed script. Thx for your work.
I small suggestion/request could you modify the syntax to give out translation files that can be used for the "Find and replace all" function in editors like Notepad++? The Begin String of the RPGMaker Trans file kinda get messed up if one use that function.
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
I'm also using Notepad++ to edit the txt files and I'm not sure I understand how > BEGIN STRING prevents you from using "Replace All in All Opened Documents" (if it's what you mean by "Find and replace all").

Changing > BEGIN STRING to > [WHATEVER YOU WANT INSTEAD] would be easy. I can remove the '>' if you're 100% sure this line will never appear in the game.
I can't easily remove the line as I still need something a delimiter to tell the patcher it's reading a new japanese text. It would also be difficult to make a delimiter that's longer than one line.

You can change the syntax and experiment yourself if you create a file Gaijinizer/Eval/Gaijinizer.rb
Then write:
Ruby:
@file_header = '> GAIJINIZER PATCH FILE'
@rmgmt_bs = '> BEGIN STRING'
@rmgmt_c = '> CONTEXT: '
@rmgmt_es = '> END STRING'
Ruby:
@file_header = '> GAIJINIZER PATCH FILE'
@rmgmt_bs = '> WHATEVER YOU WANT INSTEAD'
@rmgmt_c = '> CONTEXT: '
@rmgmt_es = '> END STRING'
 

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
I think a practical example is better to show what I mean:

> BEGIN STRING
ギルド職員
「あ、お嬢さんはダンジョンに潜るの初めてですよね?」
> CONTEXT: Map001/events/2/pages/0/15/Dialogue < UNTRANSLATED

> END STRING


> BEGIN STRING
ギルド職員
「それじゃあ一応、簡単に説明しておきますね」
> CONTEXT: Map001/events/2/pages/0/23/Dialogue < UNTRANSLATED

> END STRING

I would like to translate "ギルド職員" only in this two cases, preferably via the "Find and replace all" function. But doing so would corrupt the line between "> BEGIN STRING" and "> CONTEXT". Is there a way to get around that or does the script need the original jp text to know what to patch?
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
I think a practical example is better to show what I mean:

> BEGIN STRING
ギルド職員
「あ、お嬢さんはダンジョンに潜るの初めてですよね?」
> CONTEXT: Map001/events/2/pages/0/15/Dialogue < UNTRANSLATED

> END STRING


> BEGIN STRING
ギルド職員
「それじゃあ一応、簡単に説明しておきますね」
> CONTEXT: Map001/events/2/pages/0/23/Dialogue < UNTRANSLATED

> END STRING

I would like to translate "ギルド職員" only in this two cases, preferably via the "Find and replace all" function. But doing so would corrupt the line between "> BEGIN STRING" and "> CONTEXT". Is there a way to get around that or does the script need the original jp text to know what to patch?

Well, that's actually something I should be able to implement fairly easily.

Ruby:
if text =~ /^(.*)\n「((?:.|\n)*)」$/
text_name = $1
text_dialogue = $2
# add text_name and text_dialogue instead of text
else
# add text
end
Then you would get something like this (I'm keeping ギルド職員 in the context for obvious reasons):
> BEGIN STRING
「あ、お嬢さんはダンジョンに潜るの初めてですよね?」
> CONTEXT: Map001/events/2/pages/0/15/Dialogue/ギルド職員 < UNTRANSLATED

> END STRING


> BEGIN STRING
「それじゃあ一応、簡単に説明しておきますね」
> CONTEXT: Map001/events/2/pages/0/23/Dialogue/ギルド職員 < UNTRANSLATED

> END STRING

> BEGIN STRING
ギルド職員
> CONTEXT: Map001/events/2/pages/0/23/DialogueActor < UNTRANSLATED
> CONTEXT: Map001/events/2/pages/0/15/DialogueActor < UNTRANSLATED

> END STRING

There's just a possible issue:
/^(.*)\n「((?:.|\n)*)」$/
It's called a regular expression, you can test it here (you can also do it with Notepad++)
The question is: are all your dialogues going to match that regular expression?
For example, I've already seen stuff like this (using color escape characters):
\\C[8]ギルド職員\\C[0]
\\C[8]「\\C[0]それじゃあ一応、簡単に説明しておきますね\\C[8]」\\C[0
 
Last edited:

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
Hmm this looks interesting. I was dipping into RegEx but writing longer expressions still troubles me. The syntax can get really confusing. But the page you suggested helps. Thanks for the tip.
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
can u do something so this tool can also work with MV games?
I can and I'm interested to. But I don't have time to work on it at the moment.
Once I get somehow proficient at modding MV games and the patcher no longer needs updates for VX Ace that's certainly something I'll try to do.
If you want a tool, there are probably others out there, don't wait for me.
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Hmm this looks interesting. I was dipping into RegEx but writing longer expressions still troubles me. The syntax can get really confusing. But the page you suggested helps. Thanks for the tip.
Here's the modification you wanted. Could you test them on your game?
It should appear like this now (I can bring back the「」brackets if you want):
> BEGIN STRING
あ、お嬢さんはダンジョンに潜るの初めてですよね?
> CONTEXT: Map001/events/2/pages/0/15/Dialogue/ギルド職員 < UNTRANSLATED

> END STRING


> BEGIN STRING
それじゃあ一応、簡単に説明しておきますね
> CONTEXT: Map001/events/2/pages/0/23/Dialogue/ギルド職員 < UNTRANSLATED

> END STRING

> BEGIN STRING
ギルド職員
> CONTEXT: Map001/events/2/pages/0/23/DialogueActor < UNTRANSLATED
> CONTEXT: Map001/events/2/pages/0/15/DialogueActor < UNTRANSLATED

> END STRING
 

Attachments

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
Here's the modification you wanted. Could you test them on your game?
It should appear like this now (I can bring back the「」brackets if you want):
> BEGIN STRING
あ、お嬢さんはダンジョンに潜るの初めてですよね?
> CONTEXT: Map001/events/2/pages/0/15/Dialogue/ギルド職員 < UNTRANSLATED

> END STRING


> BEGIN STRING
それじゃあ一応、簡単に説明しておきますね
> CONTEXT: Map001/events/2/pages/0/23/Dialogue/ギルド職員 < UNTRANSLATED

> END STRING

> BEGIN STRING
ギルド職員
> CONTEXT: Map001/events/2/pages/0/23/DialogueActor < UNTRANSLATED
> CONTEXT: Map001/events/2/pages/0/15/DialogueActor < UNTRANSLATED

> END STRING
Tried it out with RJ196116 Princess Zeven (1.10 partial translated version) and getting this error:

Code:
---------------------------
Gaijinizer
---------------------------
Script 'Gaijinizer Patchmaker' line 738: IndexError occurred.

index -2 out of string
Another small suggestion: Could you add an option that let the patcher fill in an exact copy of the untranslated text into the translation line? Something like this:

> BEGIN STRING
ギルド職員
「それじゃあ一応、簡単に説明しておきますね」
> CONTEXT: Map001/events/2/pages/0/23/Dialogue < UNTRANSLATED
ギルド職員
「それじゃあ一応、簡単に説明しておきますね」
> END STRING

This would save some time in certain situations where you have to copy pasta humongous amount of text.
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Tried it out with RJ196116 Princess Zeven (1.10 partial translated version) and getting this error:
...
For the bug, try replacing Gaijinizer/Eval by the new one in the attached file.


As for the suggestion, I can do it very easily.
But by default, if you leave
> BEGIN STRING
ギルド職員
「それじゃあ一応、簡単に説明しておきますね」
> CONTEXT: Map001/events/2/pages/0/23/Dialogue < UNTRANSLATED

> END STRING

Then your text:
"ギルド職員
「それじゃあ一応、簡単に説明しておきますね」"
Isn't going to change (except if it's a bug that I may not be aware of because I've not tested not filling the translation).

Still, if that's really something you want then you can append the file Gaijinizer/Eval/Gaijinizer.rb (using Notepad++) with:
Ruby:
  def self.write_string_untled(text, c = [[]], tag = @untled_tag)
    s = ''
    c.each do |index_array|
      context = context_from_a(index_array)
      next if !context_ok?(context)
      s << "#{@rmgmt_c}#{context}#{tag}\n"
    end
    return "#{@rmgmt_bs}\n#{custom_text(text)}\n#{s}#{custom_text(text)}#{@rmgmt_es}\n" if s != ''
    return nil
  end
 

Attachments

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
It works, thx for your dedication. It's great to finally have a translation tool that can be tailored to specific needs and tasks.
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Well, also thank you for bringing new ideas and reporting bugs.
 

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
Btw, another question. Can your script update translation patches when a game gets updated? Is there a "Rebuild Patch" option like in RPGMaker Trans?
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
It can although that function is still work in progress (see method wip_apply_patch_update_patch).

What it can do now:
-Update the translation if it finds a text in a new context that has been translated in a similar context.
> BEGIN STRING
ギルド職員
「それじゃあ一応、簡単に説明しておきますね」
> CONTEXT: CommonEvents/10/23/Dialogue
What a splendid--accurate--engrish train station
> CONTEXT: Map001/events/2/pages/0/23/Dialogue
Yet another splendid--accurate--engrish train station
> END STRING

finds
ギルド職員
「それじゃあ一応、簡単に説明しておきますね
in context Map589/events/1/pages/1/10/Dialogue (new)
gives same translation as most similar context Map001/events/2/pages/0/23/Dialogue
->Yet another splendid--accurate--engrish train station

What it can do with if you reactivate the WIP method:
-Append the files with the new untranslated content.
-Create a file to dump all the translation that is no longer used.

What it I'm planning to do:
-Remove the translation that is no longer used from the file themselves

I don't really need it for now as I have another tool which help me do that.
But if people need it and can explain what they need/how they need it, then I don't mind reactivating the feature.
 
Last edited:

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
Actually it would be great if the updater just look for new or changed entries during the update process und dump it to a changelog files. I sometimes prefer to update the stuff manually, especially if it's stuff in the comment line that links to scripts or scripts that call variable names.
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Makes sense, you don't want to auto-update a script string. Now that you tell me, I did have a problem one time because of that. A change log would be handy too.
I'll definitively want to add that feature as a default one.

So it might be something like:
Ruby:
#...
if @auto_update_mode == 2 #disabled
#nothing
elsif auto_update_mode1?(index_array) #change log
#find most similar context
#add most similar translation to log
elsif @auto_update_mode == 0 #auto (default)
#find most similar context
#add most similar translation
end
#...

def self.switch_mode_1?(index_array)
return true if @auto_update_mode == 1
return true if index_array.include?("Scripts")
return true if index_array.include?("InlineScript")
return false
end
And you would have to append your eval file with
@auto_update_mode = 1
If you only want to use the log.
 

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
My Ruby knowledge is kinda limited, but this looks really promising from what I can understand. A changelog would definitely help for translation patch updates. I sometimes have to brute force copy lines from one old translation patch to a newer one because I can't spot the updated stuff in all the files that got changed.
 
Top