-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Translate does not preserve new line or enter #3938
Copy link
Copy link
Closed
Labels
api: translationIssues related to the Cloud Translation API API.Issues related to the Cloud Translation API API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
- OS: Debian 9
- Java version: java-1.8.0-openjdk
- google-cloud-java version(s): 1.40.0
Steps to reproduce
- Hello how are you? \n I am fine.
- 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!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: translationIssues related to the Cloud Translation API API.Issues related to the Cloud Translation API API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.