Skip to content

Translate does not preserve new line or enter #3938

@trueman1

Description

@trueman1
  • OS: Debian 9
  • Java version: java-1.8.0-openjdk
  • google-cloud-java version(s): 1.40.0

Steps to reproduce

  1. Hello how are you? \n I am fine.
  2. Translated text does not preserve new line.

Code snippet

        String text = "how are you\n I am fine";


        Translation translation =
                CGlobals.g_Translate.translate(
                        text,
                        Translate.TranslateOption.model("nmt"),
                        com.google.cloud.translate.Translate.TranslateOption.sourceLanguage("en"),
                        com.google.cloud.translate.Translate.TranslateOption.targetLanguage("mr"));

        //System.out.printf("Text: %s%n", text);
        String translatedText = translation.getTranslatedText();

        System.out.printf("Translation: %s%n", translatedText);

Thanks!

Metadata

Metadata

Assignees

Labels

api: translationIssues related to the Cloud Translation API API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions