We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 796c52e commit 769a28fCopy full SHA for 769a28f
translate/snippets/src/main/java/com/example/translate/QuickstartSample.java
@@ -27,14 +27,17 @@ public class QuickstartSample {
27
public static void main(String... args) throws Exception {
28
// Instantiates a client
29
Translate translate = TranslateOptions.builder().apiKey("YOUR_API_KEY").build().service();
30
+
31
// The text to translate
32
String text = "Hello, world!";
33
34
// Translates some text into Russian
35
Translation translation = translate.translate(
36
text,
37
TranslateOption.sourceLanguage("en"),
38
TranslateOption.targetLanguage("ru")
39
);
40
41
System.out.printf("Text: %s%n", text);
42
System.out.printf("Translation: %s%n", translation.translatedText());
43
}
0 commit comments