maximumspoil / witcher3dualsubtitles

6 stars 3 forks source link

Cyrillic symbols -- with EN text being first [WORKAROUND] #1

Open 0xotHik opened 1 month ago

0xotHik commented 1 month ago

Hi there!

User middle1961 on Nexus Mods wrote that:

Please check your program, because if you translate from English into Russian, then instead of Russian text, strange characters are written. And this is a working program, a good job)

I got that too. I guess, when you choose English language -- the game does not load "unnecessary" symbols, and cyrillic letters turns into mess. If you do the way around --

python dual_subtitles.py en ru "\TheWitcher3\content"

and "dlc" as well -- and select Russian Text in-game -- you get Russian text and then English text with no problem

So what I did -- in 214 line of "dual_subtitles.py" I inserted this line target_file = os.path.join(dirpath, source_lang + ".w3strings.csv")

So that block of code in the end looks this:

                        print("Merging " + source_file + " " + target_file) 
                        merged_lines = merge_content(source_file, target_file, should_merge)

                        target_file = os.path.join(dirpath, source_lang + ".w3strings.csv")

                        # Write the updated content to the target file
                        with open(target_file, 'w', encoding="utf8") as target:
                            target.writelines(merged_lines)

                        # Process the resulting CSV file using w3strings.exe -e
                        subprocess.run(["w3strings.exe",  "--force-ignore-id-space-check-i-know-what-i-am-doing", "-e", target_file])

                        merged = True

And it worked -- on v.4.04 -- if you choose RU text.

All of above -- just a workaround for those, who want EN text first, and then RU text (or maybe that's the case with some other languages too) in the end.

maximumspoil commented 4 weeks ago

You guys are tenacious! Ok looking into this.

maximumspoil commented 4 weeks ago

The workaround is unacceptable, as it is the target file that needs to be edited, which corresponds to the audio.

maximumspoil commented 4 weeks ago

I'm not sure on how to force the encoding when english is used (putting the RU translation into English for example). Maybe it's the game files that determine which encoding is used.

0xotHik commented 4 weeks ago

Just in case, to clarify -- personally, I'm not asking for a solution; I used this workaround, and just posted it here in case someone will find it useful :) Thank you -- for your work :)