Tool RPGM DazedMTLTool - A tool that provides quality MTL translations using ChatGPT

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,180
20,888
would this work for korean or chinese btw?
It can but you would need to go into the code and modify the regexes and instances of 'English' and 'Japanese' to whatever language you want
 

xeratzy

Member
Apr 2, 2018
127
79
It can but you would need to go into the code and modify the regexes and instances of 'English' and 'Japanese' to whatever language you want
would that be hard to do? are the regexes all over the code or are we talking a single code file? I assume its the modules files?

Would I just swap out your japanese regex
r'[一-龠]+|[ぁ-ゔ]+|[ァ-ヴー]+'

to chinese(simplified) as an example:

r'[\u4E00-\u9FFF]+'

or does it not support unicode range?
 
Last edited:

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,180
20,888
would that be hard to do? are the regexes all over the code or are we talking a single code file? I assume its the modules files?

Would I just swap out your japanese regex
r'[一-龠]+|[ぁ-ゔ]+|[ァ-ヴー]+'

to chinese(simplified) as an example:

r'[\u4E00-\u9FFF]+'

or does it not support unicode range?
It does you can use unicode range. It shouldn't be too hard you can Ctrl+f r' to find them all. modules are the only ones that need changing (And maybe the prompt.txt). Each file is based on an engine and there are really only 2 atm, mv and ace.
 
  • Like
Reactions: xeratzy

xeratzy

Member
Apr 2, 2018
127
79
Sorry for asking, this is from the mv module:



Line 214 and multiple others

Code:
        # Need to remove outside code
        jaString = re.sub(r'^[^一-龠ぁ-ゔァ-ヴー\<\>【】]+', '', jaString)
does all these need to be edited too?

if I read the regex right it should be something like this?

r'^[^\u4E00-\u9FFF\<\>【】]+'



Line 429
Code:
            tokens += translateNote(name, r'<特徴1:([^>]*)>')
Line 435
Code:
            tokens += translateNote(name, r'<SG説明:([^>]*)>')
How common are these? albeit i only dabbled a bit with translation++ before, I don't think I ever encountered an <SG . . .> event.
What's the english equivalent for the <特徴 . . .>?



Line 1148
Code:
context = 'Character Context: 莉音 == Rio | Female, 結衣 == Yui | Female, 美雪 == Miyuki | Female, あかり == Akari | Female, カガミ == Kagami | Female, ミズキ == Mizuki | Female, スズカ == Suzuka | Female, シズク == Shizuku | Female, 太郎 == Taro | Male'
Is this game specific?
 

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,180
20,888
Sorry for asking, this is from the mv module:



Line 214 and multiple others

Code:
        # Need to remove outside code
        jaString = re.sub(r'^[^一-龠ぁ-ゔァ-ヴー\<\>【】]+', '', jaString)
does all these need to be edited too?

if I read the regex right it should be something like this?

r'^[^\u4E00-\u9FFF\<\>【】]+'
Yup, it just matches any non-japanese characters and removes it. Basically `一-龠ぁ-ゔァ-ヴー` is just matching Japanese characters so you can probably replace that with`\u4E00-\u9FFF\` and it will probably work.
Line 429
Code:
            tokens += translateNote(name, r'<特徴1:([^>]*)>')
Line 435
Code:
            tokens += translateNote(name, r'<SG説明:([^>]*)>')
How common are these? albeit i only dabbled a bit with translation++ before, I don't think I ever encountered an <SG . . .> event.
What's the english equivalent for the <特徴 . . .>?
Game specific, doubt any non-japanese devs use those. They are usually extra text for skills, items, weapons, etc. Not all games use this but I've run into a few.


Line 1148
Code:
context = 'Character Context: 莉音 == Rio | Female, 結衣 == Yui | Female, 美雪 == Miyuki | Female, あかり == Akari | Female, カガミ == Kagami | Female, ミズキ == Mizuki | Female, スズカ == Suzuka | Female, シズク == Shizuku | Female, 太郎 == Taro | Male'
Is this game specific?
Yes, that's for Winter Memories. It gives GPT the names and genders of the characters to improve the consistency of the translation.
 
  • Like
Reactions: xeratzy

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,180
20,888
Any reason why we are setting names and gender in both prompt and in the module?
Prompt example in the repo is outdated. I just do it in the module now.

Updated it just now.
 
Last edited:
  • Like
Reactions: xeratzy

xeratzy

Member
Apr 2, 2018
127
79
I have encountered an error at the

In VSCode Click Terminal > New Terminal to open up the terminal. Open up start.py by double clicking it. Then press F5 and select Python file to startup the program. Then in the tool select Translate and MV/MZ to start the translation. The tool will begin translating everything inside. As soon as it hits that line it will stop like so.
When I select python file it returns the error:


Code:
Exception has occurred: SyntaxError
invalid syntax (main.py, line 24)
  File "F:\Gamez\VN\_Tools - translation\DazedMTLTool-master\start.py", line 1, in <module>     from modules.main import main SyntaxError: invalid syntax (main.py, line 24)
 

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,180
20,888
I have encountered an error at the



When I select python file it returns the error:


Code:
Exception has occurred: SyntaxError
invalid syntax (main.py, line 24)
  File "F:\Gamez\VN\_Tools - translation\DazedMTLTool-master\start.py", line 1, in <module>     from modules.main import main SyntaxError: invalid syntax (main.py, line 24)
Want to message me on Discord? I can probably help you better there.
 

timanuk

Member
Nov 15, 2017
116
114
dazedanon I have found an interesting AI chat. Have you tried working with it?

 

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,180
20,888
dazedanon I have found an interesting AI chat. Have you tried working with it?

I haven't but Claude 2 is more expensive than GPT4 and I hear more sensitive with the filter.

I didnt tried it yet but is there any "one-click" translation like in MTooL?
Nope. Its more for people who want control over each step of the MTL process and plan to make edits to it.
 
  • Sad
Reactions: EnterYourNameHere

KordNTR

Member
Aug 7, 2017
123
366
I am guessing there is no way to translate quickly via the web interface? It is sad that the API of GPT4 is so expensive. Hopefully it drops to 3.5 prices in the future.
 

daiaji

Newbie
Dec 14, 2017
23
13
I haven't but Claude 2 is more expensive than GPT4 and I hear more sensitive with the filter.



Nope. Its more for people who want control over each step of the MTL process and plan to make edits to it.
GPT-3.5-turbo-16k should be cheaper, right? It seems sufficient for translation tasks.
 

Oir

Active Member
Nov 5, 2018
568
780
Unity games often are translated by extracting text to a .txt file.
Would you be able to adapt the tool for this use-case?

If you do decide to do this, here is the formatting that the text files normally use (reipatcher for unity)

Code:
Yes、調査開始=I've arrived at the location.
彼女はウユハート・ヴァーグマイン。\n汚染された地域の調査や生物兵器(怪物)を駆除する組織に属している。=She is Uyu Heart Vagmine.\nShe belongs to an organization that specializes in investigating contaminated areas and exterminating biological weapons (monsters).
彼女は現在、単独での任務を行っており\n新兵器の実地試験と潜伏する怪物の討伐。\nそして、現地の簡易調査を行っている。=Currently, she's undertaking a solo mission,\ninvolving field testing a new weapon and subduing lurking monsters.\nAdditionally, she's conducting a brief on-site investigation.
\n indicates a line break.
It's finicky about spaces/line breaks so you have to keep the formatting the same.

Also, how do you get around the content policies for GPT3.5? I've tried to use it and I always get interrupted as soon as it detects anything sexual in the translation. Or is that only specific to the web interface?
 
Last edited:

dazedanon

Engaged Member
Modder
Uploader
Donor
Jul 24, 2017
2,180
20,888
Unity games often are translated by extracting text to a .txt file.
Would you be able to adapt the tool for this use-case?

If you do decide to do this, here is the formatting that the text files normally use (reipatcher for unity)

Code:
Yes、調査開始=I've arrived at the location.
彼女はウユハート・ヴァーグマイン。\n汚染された地域の調査や生物兵器(怪物)を駆除する組織に属している。=She is Uyu Heart Vagmine.\nShe belongs to an organization that specializes in investigating contaminated areas and exterminating biological weapons (monsters).
彼女は現在、単独での任務を行っており\n新兵器の実地試験と潜伏する怪物の討伐。\nそして、現地の簡易調査を行っている。=Currently, she's undertaking a solo mission,\ninvolving field testing a new weapon and subduing lurking monsters.\nAdditionally, she's conducting a brief on-site investigation.
\n indicates a line break.
It's finicky about spaces/line breaks so you have to keep the formatting the same.

Also, how do you get around the content policies for GPT3.5? I've tried to use it and I always get interrupted as soon as it detects anything sexual in the translation. Or is that only specific to the web interface?
Yup I could I just haven't done a Unity game yet since it usually requires a complete text file first. That means a requester would have to provide me with such a file or I would have to go through every single piece of text I could find in the game first. If you have a game in mind feel free to let me know and I can pick it up and at the same time create a script for Unity.

Web Interface is way stricter than API for content policy.
 
Last edited: