amazonka-translate-2.0: Amazon Translate SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Translate.TranslateText

Description

Translates input text from the source language to the target language. For a list of available languages and language codes, see Supported languages.

Synopsis

Creating a Request

data TranslateText Source #

See: newTranslateText smart constructor.

Constructors

TranslateText' 

Fields

  • settings :: Maybe TranslationSettings

    Settings to configure your translation output, including the option to set the formality level of the output text and the option to mask profane words and phrases.

  • terminologyNames :: Maybe [Text]

    The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology list at most in a TranslateText request. Terminology lists can contain a maximum of 256 terms.

  • text :: Text

    The text to translate. The text string can be a maximum of 10,000 bytes long. Depending on your character set, this may be fewer than 10,000 characters.

  • sourceLanguageCode :: Text

    The language code for the language of the source text. The language must be a language supported by Amazon Translate. For a list of language codes, see Supported languages.

    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.

    If you specify auto, you must send the TranslateText request in a region that supports Amazon Comprehend. Otherwise, the request returns an error indicating that autodetect is not supported.

  • targetLanguageCode :: Text

    The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.

Instances

Instances details
ToJSON TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

ToHeaders TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

ToPath TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

ToQuery TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

AWSRequest TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

Associated Types

type AWSResponse TranslateText #

Generic TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

Associated Types

type Rep TranslateText :: Type -> Type #

Read TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

Show TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

NFData TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

Methods

rnf :: TranslateText -> () #

Eq TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

Hashable TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

type AWSResponse TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

type Rep TranslateText Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

type Rep TranslateText = D1 ('MetaData "TranslateText" "Amazonka.Translate.TranslateText" "amazonka-translate-2.0-L0mihfp7dIB5vR5cgIREJ6" 'False) (C1 ('MetaCons "TranslateText'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "settings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe TranslationSettings)) :*: S1 ('MetaSel ('Just "terminologyNames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text]))) :*: (S1 ('MetaSel ('Just "text") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "sourceLanguageCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "targetLanguageCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newTranslateText Source #

Create a value of TranslateText with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

TranslateText, translateText_settings - Settings to configure your translation output, including the option to set the formality level of the output text and the option to mask profane words and phrases.

TranslateText, translateText_terminologyNames - The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology list at most in a TranslateText request. Terminology lists can contain a maximum of 256 terms.

$sel:text:TranslateText', translateText_text - The text to translate. The text string can be a maximum of 10,000 bytes long. Depending on your character set, this may be fewer than 10,000 characters.

TranslateText, translateText_sourceLanguageCode - The language code for the language of the source text. The language must be a language supported by Amazon Translate. For a list of language codes, see Supported languages.

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.

If you specify auto, you must send the TranslateText request in a region that supports Amazon Comprehend. Otherwise, the request returns an error indicating that autodetect is not supported.

TranslateText, translateText_targetLanguageCode - The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.

Request Lenses

translateText_settings :: Lens' TranslateText (Maybe TranslationSettings) Source #

Settings to configure your translation output, including the option to set the formality level of the output text and the option to mask profane words and phrases.

translateText_terminologyNames :: Lens' TranslateText (Maybe [Text]) Source #

The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology list at most in a TranslateText request. Terminology lists can contain a maximum of 256 terms.

translateText_text :: Lens' TranslateText Text Source #

The text to translate. The text string can be a maximum of 10,000 bytes long. Depending on your character set, this may be fewer than 10,000 characters.

translateText_sourceLanguageCode :: Lens' TranslateText Text Source #

The language code for the language of the source text. The language must be a language supported by Amazon Translate. For a list of language codes, see Supported languages.

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.

If you specify auto, you must send the TranslateText request in a region that supports Amazon Comprehend. Otherwise, the request returns an error indicating that autodetect is not supported.

translateText_targetLanguageCode :: Lens' TranslateText Text Source #

The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.

Destructuring the Response

data TranslateTextResponse Source #

See: newTranslateTextResponse smart constructor.

Constructors

TranslateTextResponse' 

Fields

Instances

Instances details
Generic TranslateTextResponse Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

Associated Types

type Rep TranslateTextResponse :: Type -> Type #

Read TranslateTextResponse Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

Show TranslateTextResponse Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

NFData TranslateTextResponse Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

Methods

rnf :: TranslateTextResponse -> () #

Eq TranslateTextResponse Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

type Rep TranslateTextResponse Source # 
Instance details

Defined in Amazonka.Translate.TranslateText

type Rep TranslateTextResponse = D1 ('MetaData "TranslateTextResponse" "Amazonka.Translate.TranslateText" "amazonka-translate-2.0-L0mihfp7dIB5vR5cgIREJ6" 'False) (C1 ('MetaCons "TranslateTextResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "appliedSettings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe TranslationSettings)) :*: (S1 ('MetaSel ('Just "appliedTerminologies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [AppliedTerminology])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))) :*: (S1 ('MetaSel ('Just "translatedText") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "sourceLanguageCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "targetLanguageCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newTranslateTextResponse Source #

Create a value of TranslateTextResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:appliedSettings:TranslateTextResponse', translateTextResponse_appliedSettings - Settings that configure the translation output.

$sel:appliedTerminologies:TranslateTextResponse', translateTextResponse_appliedTerminologies - The names of the custom terminologies applied to the input text by Amazon Translate for the translated text response.

$sel:httpStatus:TranslateTextResponse', translateTextResponse_httpStatus - The response's http status code.

$sel:translatedText:TranslateTextResponse', translateTextResponse_translatedText - The translated text.

TranslateText, translateTextResponse_sourceLanguageCode - The language code for the language of the source text.

TranslateText, translateTextResponse_targetLanguageCode - The language code for the language of the target text.

Response Lenses

translateTextResponse_appliedTerminologies :: Lens' TranslateTextResponse (Maybe [AppliedTerminology]) Source #

The names of the custom terminologies applied to the input text by Amazon Translate for the translated text response.

translateTextResponse_sourceLanguageCode :: Lens' TranslateTextResponse Text Source #

The language code for the language of the source text.

translateTextResponse_targetLanguageCode :: Lens' TranslateTextResponse Text Source #

The language code for the language of the target text.