SeanPesce / DXMD-Translations

Language translation framework for Deus Ex: Mankind Divided and Deus Ex: Breach
GNU General Public License v2.0
3 stars 1 forks source link

Chinese localisation #10

Open TheJackdawEK opened 3 months ago

TheJackdawEK commented 3 months ago

Hello, there Sean. Recently I began playing DX MD and I am annoyed with the poor quality of all third party Chinese localisation mods, so I decide to make my own one with better quality. Well, for now I only translate a very little bit of the strings texts. Would you mind making a Chinese build of the mod so I could give it to run to see if the mod works fine with Chinese as it is completely different from English or Turkish.

SeanPesce commented 3 months ago

IIRC Chinese support should work out of the box - do you have a JSON data set for the Chinese translation? If so, you can drop it in the retail folder, and then specify your JSON file in StringsJSON field of the configuration file (DXMD_Mod.ini).

If there are issues with font rendering, you can also try this custom font I made which should support all UTF-8 characters (make sure you add it to the UIFont field of the config file).

If you need more help, feel free to upload your Chinese JSON data set to this GitHub issue so I can mess around with it.

TheJackdawEK commented 3 months ago

That was weird, I tried to replace the Turkish.Json file with my Chinese one and modified the configuration in Mod.ini last night. But when I launching DX MD, the mod told me it can't find the Json file and then launched the vanilla game instead.

SeanPesce commented 3 months ago

Can you upload your config file, JSON data, log file, and a screenshot or something that shows your directory structure?

TheJackdawEK commented 3 months ago

I made a mistake, Actually the mod telling me "Error parsing JSON at byte 925" when launching. So I reckon it is something off with the string,Json file, isn't it? here is my Chinese localisation mod, for now I only did a little bit of the mission brief of System Rift. With the Error notification and directory screenshot as well. Cn Localisation.zip Directory

Error

TheJackdawEK commented 3 months ago

Somehow I managed to make it work!!! The only problem now I think is the Font, it keeps showing me this even with the custom font you made 20240611235813_1

SeanPesce commented 3 months ago

OK so the original issue was that your Chinese strings were encoded with GB2312, but the rest of the JSON file is encoded with UTF-8. Also, I believe the JSON library used by the DLL only supports UTF-8. Long story short, you have to make sure your translated strings are encoded with UTF-8 instead of GB2312. I know this might be annoying, but unfortunately it's the only way it will work.

I've converted your current translations to UTF-8 as a start; hopefully that helps.

As you've already pointed out, it looks like the custom fonts don't actually support Chinese characters, so we'll have to look into that. It should be possible though.

SeanPesce commented 3 months ago

Here's a temporary test DLL and font file with partial Chinese font support. It still seems to be missing some characters though; I'll need to look into it when I have more time.

DLL

Font

Example image:

20240611130305_1

SeanPesce commented 3 months ago

Update: This font file should have full Chinese character support.

TheJackdawEK commented 3 months ago

Greetings Sean, I gave it another shot with the new files and font you uploaded lately to see if it works. You know what, it is working like a charm and no more missing characters. All I need to do now is to finish my translation project. Just wanted you to know that I am really appreciated for your support these days, thank you!!! By the way, after I finished my project, could I post it on other sites? And I will credit you and Killerbeer for making this translation mod and extract English localisation strings for sure.

SeanPesce commented 3 months ago

You know what, it is working like a charm and no more missing characters.

Awesome; I'm going to add it to the official set of fonts in the repository then.

after I finished my project, could I post it on other sites?

Yes of course, I prefer that you do!

KillerBeer01 commented 3 months ago

All I need to do now is to finish my translation project

It looks like you have a long road ahead of you... I'll try to make the editor I wrote into some presentable form, maybe you'll be able to use it as well.

TheJackdawEK commented 3 months ago

It looks like you have a long road ahead of you... I'll try to make the editor I wrote into some presentable form, maybe you'll be able to use it as well.

That is very kind of you, mate, thank you. Also I think I may need at least half a year in only translation job, would be another story for proof-reading I guess, it is no doubt a long road ahead.

KillerBeer01 commented 3 months ago

MD_Editor.zip

All right, here we go...

Keep in mind, that everything I made here, I made for myself, with functions and amenities I thought necessary, and with the level of comfort (or lack thereof) I thought acceptable for myself. Feel free to criticize, but don't expect wonders.

The editor is written in Java, so you will need to install a runtime. Once you do, edit the DXMD_Text_Editor.bat to have correct paths for .json files (first should be the Chinese file you edit, second the side-by-side English file you use for reference), and launch it. You should get a couple of windows - one for the main body of texts, another specifically for cutscenes, but you can open and close more windows as you want - every window you open will represent the same pair of files, so you can view and compare separate segments of the translation if you need. Double click on a text field makes it editable (but don't do so if your text contains newlines, they'll be mangled). Right-click on a text field opens a panel where you can edit texts of any size. For basic editing of text files, that should be enough.

If, on the other hand, you want not just to see the editable text, but also be able to hear the voice lines are spoken with... then there's a lot of additional work, and I can't even guarantee that everything will work from the first time; for me it was a many iterations process until I got everything I wanted, and maybe it'll be again for you.

First, you'll need to edit and launch runParser.bat (make sure your computer has a lot of RAM, the extractor does need it). If everything goes well, you should have an "audio" folder (most important), lots of .bik video files, and a lot of .srt subtitle files. The audio folder will contain .fsb files, though, so you will need an additional step to extract them too.

The python-fsb5 extractor is not mine, I found it here https://github.com/HearthSim/python-fsb5, but I had to edit it in order to write every extracted file to the same folder it took the source file from, instead of the special output folder. I also tried to make it read the folders recursively, but for some reason it used to stop (not crash) mid-work, so you can use fsb.bat to exract them separately.

Bik files can not be played with subtitles, for all I know, so you'll have to convert them too. Install RAD Video Tools, open each of the files, and select "Convert a file" using audio track #4 for English voiceover (sadly, sound effects are in a different track; perhaps you can merge them if you're really stubborn). You'll be able to create subtitles for them from the editor, but to get the automatically generated batch right, rename them with renameSrt.bat

{to be continued}

KillerBeer01 commented 3 months ago

You will also need to edit the config.cfg for correct paths to folders and audio/video player (beside cutscenes, some in-game dialogues squeeze the whole interaction into a single text line, so you will want to play them in an external player that can show subtitles).

Finally, the original Sean's strings.json file has no mapped audio tags that are necessary for the editor to play them, so you better use this one: StringsEnglishAudio.zip Make a copy of it and use for the translation, and the original for reference. Audio tags do not mess with Sean's engine, so you don't have to bother with removing them before playing.

I hope that's all that you need to make it work [crosses fingers]. I might have forgotten something, though, so me may need to work through it together.

TheJackdawEK commented 3 months ago

I hope that's all that you need to make it work [crosses fingers]. I might have forgotten something, though, so me may need to work through it together.

Wow, that would be very helpful. Much appreciated for these tools and files here. I think I would start with the basic strings editing which is the translation job of course, and to see if I got more motivation for the advanced editing with voice-lines during the proofreading session cause it is a little bit complicated for me though.

KillerBeer01 commented 3 months ago

I'd still recommend you to use the edited strings file in case you plan to unpack sounds later, that way you won't have to apply audio tags to already formed translation. Plus, this version has extended subtitles to cutscenes where the original file didn't have them or they were poorly timed - for example, Eliza's comments for the ending scenes, where subtitles only start with Adam/Alex conversation.

TheJackdawEK commented 3 months ago

I'd still recommend you to use the edited strings file in case you plan to unpack sounds later, that way you won't have to apply audio tags to already formed translation. Plus, this version has extended subtitles to cutscenes where the original file didn't have them or they were poorly timed - for example, Eliza's comments for the ending scenes, where subtitles only start with Adam/Alex conversation.

Alright, thanks for the tips, mate. I will check this one later.

KiostarLand commented 1 month ago

我们也在做这个项目,你是一个人汉化吗?

TheJackdawEK commented 1 month ago

我们也在做这个项目,你是一个人汉化吗?

是啊,不过因为也就一个人,加上工作比较忙,两个月也没做多少,目前只翻译完了人类革命回顾视频,序章的部分剧情过场对话,和游戏内的一部分UI与菜单文本

KiostarLand commented 1 month ago

啊,我们这边缺翻译,人数太少了,我也有些无力,我个人做了个deus ex系列的小站以及群组,里面包含很多之前翻译的设定作品,这边还有小说就可以把全系列的出版物翻译完成了,你要加入吗?我们这边去年测试的时候,用的机翻,中文可以显示出来,除了还有一点点小瑕疵没解决,还在继续修缮中。 这个你有兴趣加入我们吗? 我个人也是从高中做到上班,都没做完,惭愧了。23333

TheJackdawEK commented 1 month ago

啊,我们这边缺翻译,人数太少了,我也有些无力,我个人做了个deus ex系列的小站以及群组,里面包含很多之前翻译的设定作品,这边还有小说就可以把全系列的出版物翻译完成了,你要加入吗?我们这边去年测试的时候,用的机翻,中文可以显示出来,除了还有一点点小瑕疵没解决,还在继续修缮中。 这个你有兴趣加入我们吗? 我个人也是从高中做到上班,都没做完,惭愧了。23333

有同好那肯定好啊,是QQ群还是什么吗?不过我的水平也不高,所以翻译的话,有同好一块互帮互助,效率应该会比我一个人做快一些的。

KiostarLand commented 1 month ago

群也有的,我留一下Q吧,你可以加我:3036829994 备注一下