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
Property | Pattern | Type | Deprecated | Definition | Title/Description |
---|
- targetLanguages | No | array of string | No | - | 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. |
- sourceLanguage | No | string | No | - | 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. |
- enableMT | No | boolean | No | - | 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. |
- statsOnly | No | boolean | No | - | 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```. |
- minQuality | No | integer | No | - | 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```. |
- domain | No | string | No | - | 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. |
- companyMLTRId | No | string | No | - | 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. |
- units | No | array | No | - | - |
Property root > targetLanguages
| |
---|
Type | array of string |
Required | No |
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 items | N/A |
Max items | N/A |
Items unicity | False |
Additional items | False |
Tuple validation | See below |
root > targetLanguages > targetLanguages items
Property root > sourceLanguage
| |
---|
Type | string |
Required | No |
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
| |
---|
Type | boolean |
Required | No |
Default | true |
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
| |
---|
Type | boolean |
Required | No |
Default | false |
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
| |
---|
Type | integer |
Required | No |
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
| |
---|
Type | string |
Required | No |
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
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
| Array restrictions |
---|
Min items | N/A |
Max items | N/A |
Items unicity | False |
Additional items | False |
Tuple validation | See below |
Each item of this array must be | Description |
---|
units | - |
root > units > units
Property | Pattern | Type | Deprecated | Definition | Title/Description |
---|
- textType | No | string | No | - | The ID of a text type, for example, XFLD for a field label. |
- key | No | string | No | - | 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. |
+ value | No | string | No | - | The text to be translated. |
- maxLength | No | integer | No | - | 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. |
- searchData | No | object | No | In #/definitions/searchData | 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. |
Property root > units > units items > textType
| |
---|
Type | string |
Required | No |
Default | "XFLD" |
Description: The ID of a text type, for example, XFLD for a field label.
Property root > units > units items > key
| |
---|
Type | string |
Required | No |
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
| |
---|
Type | string |
Required | Yes |
Default | "User Name" |
Description: The text to be translated.
Property root > units > units items > maxLength
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
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.
Property | Pattern | Type | Deprecated | Definition | Title/Description |
---|
+ language | No | string | No | - | The ID of the language in which you want to provide a translation. |
+ value | No | string | No | - | The text in a particular target language, as specified in the ```language``` key of the ```searchData``` key. |
Property root > units > units items > searchData > language
| |
---|
Type | string |
Required | Yes |
Default | "es" |
Description: The ID of the language in which you want to provide a translation.
Property root > units > units items > searchData > value
| |
---|
Type | string |
Required | Yes |
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"}}]}
Key | Datatype | Required | Description |
---|
Accept | string | | |
RESPONSES
status: OK
{"info":"To inspect the schema of this API's response, click on the Visualize tab","units":[{"textType":"XFLD","domain":"BC","key":"LOGIN_USERNAME_FIELD","value":"User Name","translations":[{"language":"de","value":"Benutzer","translationProvider":0,"qualityIndex":95}]},{"textType":"XFLD","domain":"BC","key":"LOGIN_USERNAME_FIELD","value":"User Name","translations":[{"language":"de","value":"Benutzername","translationProvider":0,"qualityIndex":95}]}]}