Skip to content

Commit 05147a4

Browse files
committed
Add translate_detect_language tags.
1 parent 4619631 commit 05147a4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

translate/src/main/java/com/example/cloud/translate/samples/TranslateText.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class TranslateText {
3535
* @param sourceText source text to be detected for language
3636
* @param out print stream
3737
*/
38+
//[START translate_detect_language]
3839
public static void detectLanguage(String sourceText, PrintStream out) {
3940
Translate translate = createTranslateService();
4041
List<Detection> detections = translate.detect(ImmutableList.of(sourceText));
@@ -43,6 +44,7 @@ public static void detectLanguage(String sourceText, PrintStream out) {
4344
out.printf("\t%s\n", detection);
4445
}
4546
}
47+
//[END translate_detect_language]
4648

4749
/**
4850
* Translates the source text in any language to English.

0 commit comments

Comments
 (0)