The '/translate' method enables you to get translations of English short texts that exist in SAP Translation Hub.

POST {{baseUrl}}/translate

Provides translations of short texts based on a combination of existing texts and their translations that are used in SAP products and machine translation capabilities.

Schema Docs

Typeobject
RequiredNo
Additional properties[Any type: allowed]
PropertyPatternTypeDeprecatedDefinitionTitle/Description
- targetLanguagesNoarray of stringNo-The codes of the target languages in which you want the method to return translations of texts. To view the IDs of the supported languages, call the SAP Translation Hub '/languages' method. If you do not specify any target languages, the method returns the texts in all available target languages.
- sourceLanguageNostringNo-Enables you to specify a source language other than English. You can enter the code of any of the languages that SAP Translation Hub supports as a source language. If you do not use this parameter, the API assumes that the source language is English. To see which combinations of source and target languages are supported, see Supported Languages.
- enableMTNobooleanNo-Determines whether SAP Translation Hub translates texts using SAP Machine Translation (SAP MT) in addition to the multilingual text repository (MLTR). By default, SAP MT is active. If you want to deactivate it, enter ```false``` as the value of this key.
- statsOnlyNobooleanNo-If this option is set to ```true``` then the language, translationProvider and the qualityIndex will be shown in the translations but not the value. By default, the value of this key is ```false```.
- minQualityNointegerNo-This parameter filters the results such that only the translations whose qulityIndex is greater than or equal to the value mentioned here is displayed. By default, the value of this key is ```0```.
- domainNostringNo-The ID of a translation domain, for example, BC. If you do not specify a domain, the method searches for translations in all available domains.
- companyMLTRIdNostringNo-The ID of a company MLTR. To get the ID of a company MLTR, see the address bar of the UI for company MLTRs. For more information, see Access UIs for Integrating Your Own Language Data.
- unitsNoarrayNo--

Property root > targetLanguages

Typearray of string
RequiredNo
Default["es", "fr"]

Description: The codes of the target languages in which you want the method to return translations of texts. To view the IDs of the supported languages, call the SAP Translation Hub '/languages' method. If you do not specify any target languages, the method returns the texts in all available target languages.

Array restrictions
Min itemsN/A
Max itemsN/A
Items unicityFalse
Additional itemsFalse
Tuple validationSee below
Each item of this array must beDescription
targetLanguages items-

root > targetLanguages > targetLanguages items

Typestring
RequiredNo

Property root > sourceLanguage

Typestring
RequiredNo
Default"en"

Description: Enables you to specify a source language other than English. You can enter the code of any of the languages that SAP Translation Hub supports as a source language. If you do not use this parameter, the API assumes that the source language is English. To see which combinations of source and target languages are supported, see Supported Languages.

Property root > enableMT

Typeboolean
RequiredNo
Defaulttrue

Description: Determines whether SAP Translation Hub translates texts using SAP Machine Translation (SAP MT) in addition to the multilingual text repository (MLTR). By default, SAP MT is active. If you want to deactivate it, enter false as the value of this key.

Property root > statsOnly

Typeboolean
RequiredNo
Defaultfalse

Description: If this option is set to true then the language, translationProvider and the qualityIndex will be shown in the translations but not the value. By default, the value of this key is false.

Property root > minQuality

Typeinteger
RequiredNo
Default"0"

Description: This parameter filters the results such that only the translations whose qulityIndex is greater than or equal to the value mentioned here is displayed. By default, the value of this key is 0.

Property root > domain

Typestring
RequiredNo
Default"BC"

Description: The ID of a translation domain, for example, BC. If you do not specify a domain, the method searches for translations in all available domains.

Property root > companyMLTRId

Typestring
RequiredNo

Description: The ID of a company MLTR. To get the ID of a company MLTR, see the address bar of the UI for company MLTRs. For more information, see Access UIs for Integrating Your Own Language Data.

Property root > units

Typearray
RequiredNo
Array restrictions
Min itemsN/A
Max itemsN/A
Items unicityFalse
Additional itemsFalse
Tuple validationSee below
Each item of this array must beDescription
units-

root > units > units

Typeobject
RequiredNo
Additional properties[Any type: allowed]
Defined in#/definitions/units
PropertyPatternTypeDeprecatedDefinitionTitle/Description
- textTypeNostringNo-The ID of a text type, for example, XFLD for a field label.
- keyNostringNo-A key that helps you to uniquely identify a particular text and its subsequent translations in the units key. SAP Translation Hub stores this key with the text in the service request to make it easier to identify specific texts and their translations than by using the texts alone. For example, if you specify a key for each text in a properties file that you want to translate, you can use the key to identify the translations for each text in the target properties files.
The key is stored only to make it easier to identify the text in the units key; it is not stored for future reference in the multilingual text repository.
+ valueNostringNo-The text to be translated.
- maxLengthNointegerNo-The maximum number of characters that you want translations to comprise. Note: If the API is not able to find translations of the required length for at least one target language, the request does not contain any translations.
- searchDataNoobjectNoIn #/definitions/searchDataA parameter that allows you to specify the translation of a UI text in one of the target languages. You use this parameter if you know that there are multiple possible translations for a given source text, and you want to restrict the results to a specific translation. For example, take the word 'Cancel'. The German translation could be 'Abbrechen' or 'Stornieren'. If you know that the German translation in a given instance should be 'Abbrechen', you can specify 'Abbrechen' so that the correct translation in German (and in other languages) is returned.

Property root > units > units items > textType

Typestring
RequiredNo
Default"XFLD"

Description: The ID of a text type, for example, XFLD for a field label.

Property root > units > units items > key

Typestring
RequiredNo
Default"LOGIN_USERNAME_FIELD"

Description: A key that helps you to uniquely identify a particular text and its subsequent translations in the units key. SAP Translation Hub stores this key with the text in the service request to make it easier to identify specific texts and their translations than by using the texts alone. For example, if you specify a key for each text in a properties file that you want to translate, you can use the key to identify the translations for each text in the target properties files.
The key is stored only to make it easier to identify the text in the units key; it is not stored for future reference in the multilingual text repository.

Property root > units > units items > value

Typestring
RequiredYes
Default"User Name"

Description: The text to be translated.

Property root > units > units items > maxLength

Typeinteger
RequiredNo

Description: The maximum number of characters that you want translations to comprise. Note: If the API is not able to find translations of the required length for at least one target language, the request does not contain any translations.

Property root > units > units items > searchData

Typeobject
RequiredNo
Additional properties[Any type: allowed]
Defined in#/definitions/searchData

Description: A parameter that allows you to specify the translation of a UI text in one of the target languages. You use this parameter if you know that there are multiple possible translations for a given source text, and you want to restrict the results to a specific translation. For example, take the word 'Cancel'. The German translation could be 'Abbrechen' or 'Stornieren'. If you know that the German translation in a given instance should be 'Abbrechen', you can specify 'Abbrechen' so that the correct translation in German (and in other languages) is returned.

PropertyPatternTypeDeprecatedDefinitionTitle/Description
+ languageNostringNo-The ID of the language in which you want to provide a translation.
+ valueNostringNo-The text in a particular target language, as specified in the ```language``` key of the ```searchData``` key.
Property root > units > units items > searchData > language
Typestring
RequiredYes
Default"es"

Description: The ID of the language in which you want to provide a translation.

Property root > units > units items > searchData > value
Typestring
RequiredYes
Default"Usuario"

Description: The text in a particular target language, as specified in the language key of the searchData key.


Generated using json-schema-for-humans on 2024-02-23 at 15:58:39 +0100

Request Body

{"targetLanguages"=>["de"], "sourceLanguage"=>"en", "enableMT"=>true, "statsOnly"=>false, "minQuality"=>"0", "domain"=>"BC", "companyMLTRId"=>"<string>", "units"=>[{"value"=>"User Name", "textType"=>"XFLD", "key"=>"LOGIN_USERNAME_FIELD", "maxLength"=>"<integer>", "searchData"=>{"language"=>"es", "value"=>"Usuario"}}, {"value"=>"User Name", "textType"=>"XFLD", "key"=>"LOGIN_USERNAME_FIELD", "maxLength"=>"<integer>", "searchData"=>{"language"=>"es", "value"=>"Usuario"}}]}

HEADERS

KeyDatatypeRequiredDescription
Acceptstring

RESPONSES

status: OK

{&quot;info&quot;:&quot;To inspect the schema of this API&#39;s response, click on the Visualize tab&quot;,&quot;units&quot;:[{&quot;textType&quot;:&quot;XFLD&quot;,&quot;domain&quot;:&quot;BC&quot;,&quot;key&quot;:&quot;LOGIN_USERNAME_FIELD&quot;,&quot;value&quot;:&quot;User Name&quot;,&quot;translations&quot;:[{&quot;language&quot;:&quot;de&quot;,&quot;value&quot;:&quot;Benutzer&quot;,&quot;translationProvider&quot;:0,&quot;qualityIndex&quot;:95}]},{&quot;textType&quot;:&quot;XFLD&quot;,&quot;domain&quot;:&quot;BC&quot;,&quot;key&quot;:&quot;LOGIN_USERNAME_FIELD&quot;,&quot;value&quot;:&quot;User Name&quot;,&quot;translations&quot;:[{&quot;language&quot;:&quot;de&quot;,&quot;value&quot;:&quot;Benutzername&quot;,&quot;translationProvider&quot;:0,&quot;qualityIndex&quot;:95}]}]}