XUnity.AutoTranslator
XUnity.AutoTranslator copied to clipboard
Fragmented text output in game leads to translation error
I apologize if I'm writing in the wrong place. I have a question.
In the game that I want to translate, the text of character dialog is not displayed in full, but in parts. First part of the sentence, then the first comma, then the continuation. As a result, first part of the sentence is translated, and then the second part, breaking the first part of the sentence.
Can this be fixed?
For example, this is what is saved in the translation file.
Good morning everyone. =Доброе утро всем.
Доброе утро всем. We'd all like to welcome you back to a new school year! =Дом.\nМы все хотели бы приветствовать вас обратно в новый учебный год!
The first fragment of the string is displayed in English. It should be transferred to the translation without changes.
Доброе утро всем. We'd all like to welcome you back to a new school year! =Доброе утро всем. Мы все хотели бы приветствовать вас обратно в новый учебный год!
And instead, the first fragment breaks.
Доброе утро всем. We'd all like to welcome you back to a new school year! =Дом.\nМы все хотели бы приветствовать вас обратно в новый учебный год!
And then there's a whole mess of stuff going on.
It's very nice to meet you all. =Очень приятно познакомиться со всеми вами.
Очень приятно познакомиться со всеми вами. If ever you're not feeling well, =О.\nЕсли ты когда -нибудь не чувствуешь себя хорошо,
О.\nЕсли ты когда -нибудь не чувствуешь себя хорошо, or just need someone to talk to, =О.\nESliTITHOGHOGODANH nusewstuesh
О.\nESliTITHOGHOGODANH nusewstuesh the doors to the counciling room will always be open to you. =О.\nEslitithogogodanh nusewstuesh Двери в комнату совета всегда будет открыто для вас.
https://github.com/bbepis/XUnity.AutoTranslator/assets/24901436/e390c4c6-2753-4e79-b96b-c656ed0b7757
And it also looks like new text can't be longer than old text. The "extra" letters are just cut off.
What a problematic game...
I noticed that the text should all end with ",", ".", or "!", then you could use regular expressions.
like this:
sr:"^(\S+?[,\.!]\s)(\S+?[,\.!]\s)(\S+?[,\.!]\s)"=$1$2$3
The above is just an example. The specific situation depends on how many paragraphs the text has been divided into.
Moreover, this does not really solve the problem; it just means that there is no need to translate the already translated text repeatedly. And, it will split all your sentences, potentially causing a lot of issues.
As for the other issue, you might need to manually add some line breaks in the translated text, I'm not certain.