| Copyright | (c) 2013-2018 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.AWS.Translate.TranslateText
Description
Translates input text from the source language to the target language. You can translate between English (en) and one of the following languages, or between one of the following languages and English.
- Arabic (ar)
- Chinese (Simplified) (zh)
- French (fr)
- German (de)
- Portuguese (pt)
- Spanish (es)
To have Amazon Translate determine the source language of your text, you can specify auto in the SourceLanguageCode field. If you specify auto , Amazon Translate will call Amazon Comprehend to determine the source language.
Synopsis
- translateText :: Text -> Text -> Text -> TranslateText
- data TranslateText
- ttText :: Lens' TranslateText Text
- ttSourceLanguageCode :: Lens' TranslateText Text
- ttTargetLanguageCode :: Lens' TranslateText Text
- translateTextResponse :: Int -> Text -> Text -> Text -> TranslateTextResponse
- data TranslateTextResponse
- ttrsResponseStatus :: Lens' TranslateTextResponse Int
- ttrsTranslatedText :: Lens' TranslateTextResponse Text
- ttrsSourceLanguageCode :: Lens' TranslateTextResponse Text
- ttrsTargetLanguageCode :: Lens' TranslateTextResponse Text
Creating a Request
Arguments
| :: Text | |
| -> Text | |
| -> Text | |
| -> TranslateText |
Creates a value of TranslateText with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
ttText- The text to translate.ttSourceLanguageCode- One of the supported language codes for the source text. If theTargetLanguageCodeis not "en", theSourceLanguageCodemust be "en". To have Amazon Translate determine the source language of your text, you can specifyautoin theSourceLanguageCodefield. If you specifyauto, Amazon Translate will call Amazon Comprehend to determine the source language.ttTargetLanguageCode- One of the supported language codes for the target text. If theSourceLanguageCodeis not "en", theTargetLanguageCodemust be "en".
data TranslateText Source #
See: translateText smart constructor.
Instances
Request Lenses
ttSourceLanguageCode :: Lens' TranslateText Text Source #
One of the supported language codes for the source text. If the TargetLanguageCode is not "en", the SourceLanguageCode must be "en". To have Amazon Translate determine the source language of your text, you can specify auto in the SourceLanguageCode field. If you specify auto , Amazon Translate will call Amazon Comprehend to determine the source language.
ttTargetLanguageCode :: Lens' TranslateText Text Source #
One of the supported language codes for the target text. If the SourceLanguageCode is not "en", the TargetLanguageCode must be "en".
Destructuring the Response
translateTextResponse Source #
Arguments
| :: Int | |
| -> Text | |
| -> Text | |
| -> Text | |
| -> TranslateTextResponse |
Creates a value of TranslateTextResponse with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
ttrsResponseStatus- -- | The response status code.ttrsTranslatedText- The text translated into the target language.ttrsSourceLanguageCode- The language code for the language of the input text.ttrsTargetLanguageCode- The language code for the language of the translated text.
data TranslateTextResponse Source #
See: translateTextResponse smart constructor.
Instances
Response Lenses
ttrsResponseStatus :: Lens' TranslateTextResponse Int Source #
- - | The response status code.
ttrsTranslatedText :: Lens' TranslateTextResponse Text Source #
The text translated into the target language.
ttrsSourceLanguageCode :: Lens' TranslateTextResponse Text Source #
The language code for the language of the input text.
ttrsTargetLanguageCode :: Lens' TranslateTextResponse Text Source #
The language code for the language of the translated text.