Forum rules - please read before posting.

Line break in Speech Translation

edited February 2019 in Technical Q&A

Hello,

I want to add line breaks to the translation. I searched in the forum and I found "\n" and "[break]" as possible solution. But both didn't work.

image

image

image

Did I missed something? I'm using

  • Unity 2018.3.6f1
  • AC 1.66.8
  • TextMeshPro for Menu Label

Best regards,
André

Comments

  • edited February 2019

    Hello,

    I tried some things and read a lot of code and at the end I simply tried to put normal carriage returns into the text field. And of course it works:

    image

    The reason why I thought that it must be more complicated is, because when I gathered the text, the carriage returns from the original text disappeared. The carriage returns were replaced by spaces. (It's visible in the first screen shot.)

    So, my problem is solved, but maybe the "Gathering Process" should respect the carriage returns of the original text.

    Best regards,
    André

  • I'll look into it, thanks for the pointer.

  • Backup your project, and in ActionSpeech.cs, look for the GetTranslatableString function (around line 472).

    Replace:

    public string GetTranslatableString (int index)
    {
        return GetSpeechArray () [index];
    }
    

    with:

    public string GetTranslatableString (int index)
    {
        if (KickStarter.speechManager.separateLines)
        {
            return GetSpeechArray () [index];
        }
        return messageText;
    }
    

    Does that solve the issue after re-gathering text?

  • Hello Chris,

    I changed the code, but re-gathering does not change anything. I'm not sure if I have to reset it first. But currently I'm a little bit afraid that I have to do all the translations again after resetting and gathering again. So... I think it's currently fine for me. :-)

    /André

  • As I said, you should back up your project before attempting any of this. Re-gathering should be enough, but so long as you hae a backup you should be fine to test if a reset does the trick.

    Bear in mind that I'm assuming you have Treate carriage returns as separate lines? unchecked in your Speech Manager.

  • Thank you! I got the same problem and this fix did the trick.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.