bbepis / XUnity.AutoTranslator

MIT License
1.98k stars 292 forks source link

Process translated text #76

Closed RichardB73 closed 4 years ago

RichardB73 commented 4 years ago

Hi, I was wondering if its possible to adjust or change the translated text before it is being displayed?

While playing Com3d2 i been fiddling with translations for a while. I noticed to get better translations when splitting up the captured text before translating using the _Preprocessors.txt file with the option ……=...\n to force a newline. Only problem i have now is how to remove the \n from the translated output text in the _AutoGeneratedTranslations.txt file.

I tried with a regex, but it only seems to work on text before it is send for translation, not on the return text.

gravydevsupreme commented 4 years ago

According to some just the inclusion of the weird 'three dot' characters can drastically decrease the quality of the translation, so perhaps simply using the following preprocessor might help:

…=。。。

Like you've done yourself, simply place this line in the _Preprocessors.txt file.

Alternatively, you can use the following "splitter regex" to split up translations to the translator whenever it sees two …:

sr:"^([\S\s]+)……([\S\s]+)$"=$1……$2
sr:"^([\S\s]+)……([\S\s]+)……([\S\s]+)$"=$1……$2……$3

This should not be placed in the _Preprocessors.txt or _AutoGeneratedTranslations.txt file, but instead an arbitrary translation file.

RichardB73 commented 4 years ago

Thank you for your reply,

I tried both options and for me the splitter regex you wrote is exactly doing what i wanted. Instead of breaking up the text like i was doing, it now gets translated the way i wanted without adding,replacing or removing text.

The preprocessor option still gave many strange translations and tried different methods like: ……=。。。 ……=。 ……=... ……=.
But all with the same result.

ghost commented 2 years ago

Hello @gravydevsupreme i just wonder, what is arbitrary translation file.