File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,7 +94,8 @@ The `confidence`_ value is an optional floating point value between 0 and 1.
9494The closer this value is to 1, the higher the confidence level for the
9595language detection. This member is not always available.
9696
97- To translate text:
97+ To translate text into the default destination language without knowing
98+ the source language:
9899
99100 .. code ::
100101
@@ -107,6 +108,18 @@ To translate text:
107108 'input': 'koszula',
108109 }
109110
111+ If the source language is known:
112+
113+ .. code ::
114+
115+ >>> from google.cloud import translate
116+ >>> client = translate.Client()
117+ >>> client.translate('camisa', source_language='es')
118+ {
119+ 'translatedText': 'shirt',
120+ 'input': 'camisa',
121+ }
122+
110123 or to use a non-default target language:
111124
112125 .. code ::
You can’t perform that action at this time.
0 commit comments