Difference between revisions of "REST API:translationWorkbench Resource"

From LongJump Support Wiki
imported>Aeric
imported>Aeric
Line 6: Line 6:
:* Translations have been created in the [[Translation Workbench]]
:* Translations have been created in the [[Translation Workbench]]


===Get a Translation===
===Get a Translation for a Custom Label===
;Method:GET
;Method:GET
 
;URI:
;URI:
:<tt><nowiki>https://{domain}/networking/rest/translationWorkBench/{elem}/{key}</nowiki></tt>
:<tt><nowiki>https://{domain}/networking/rest/translationWorkBench/customlabel/{key}</nowiki></tt>
:<tt><nowiki>https://{domain}/networking/rest/translationWorkBench/{elem}/{key}?args=param1,...</nowiki></tt>  
:<tt><nowiki>https://{domain}/networking/rest/translationWorkBench/customlabel/{key}?args=param1,...</nowiki></tt>  
:where:
:where:
::* '''{elem}''' - Is the internal name for one of the [[Translation Workbench]] elements (see table below).
::* '''{key}''' - The index value used to look up a translated string, in the form  <tt>{category}.{token_id}</tt>
::* '''{key}''' - Is the index value used to look up a translated string (table below)


{{Query Parameters|
{{Query Parameters|
::*<tt>args</tt> - A list of one or more arguments that will be interpolated into the string at the locations assigned to them when the base string was created.}}
::*<tt>args</tt> - A list of one or more arguments that will be interpolated into the string at the locations assigned to them when the base string was created.}}
;Element/Key Values:
:The element/key values are shown in this table:
:{| border="1" cellpadding="5" cellspacing="1"
! Element !! Key Format
|-
| action || <tt>{object_name}.{action_name}</tt>
|-
| application || <tt>{application_name}.{sub_type}</tt>, where <tt>{sub_type}</tt> is either <tt>label</tt> or <tt>widgetTitle</tt>.
|-
| customlabel || <tt>{category}.{token_id}</tt>
|-
| enumeratedfield || <tt>{object_name}.{enumerated_field_name}</tt>
|-
| field || <tt>{object_name}.{field_name}</tt>
|-
| form || <tt>{object_name}.{sub_type}.{layout_name}</tt>. For example, Customers.RelatedInformationSection.DefaultLayout.
|-
| globalpicklist || {{TBD|which name to use in the GUI}}
|-
| homepage || <tt>{application_name}.{sub_type}</tt>, where <tt>{sub_type}</tt> is either <tt>label</tt> or <tt>widgetTitle</tt>.
|-
| object || <tt>{object_name}</tt>
|-
| reportfolder || <tt>report_name</tt>
|-
| report || <tt>report_name</tt>
|-
| sidebar || <tt>{sub_type}.{name}</tt>, where <tt>{sub_type}</tt> is either <tt>label</tt> or <tt>widgetTitle</tt>.
|-
| validation || <tt>{object_name}.{validation_message_name}</tt>
|-
| view || <tt>{view_type}.{object_name}.{label_name}</tt>, where <tt>{view_type}</tt> is one of <tt>objectRelatedViews</tt> or <tt>otherViews</tt>.
|-
| webtab || <tt>{sub_type}.{name}</tt>, where <tt>{sub_type}</tt> is either <tt>label</tt> or <tt>widgetTitle</tt>.
|-
| workflow || <tt>{object_name}.{workflow_name}.{label_name}</tt>
|}


;Response:
;Response:
:This sample response comes in reply to the request, <tt><nowiki>http://localhost/networking/rest/translationWorkBench/customlabel/validation.record_deleted?args=5</nowiki></tt>, when the user's language is Spanish.
:This sample response comes in reply to the request, <tt><nowiki>http://{domain}/networking/rest/translationWorkBench/customlabel/validation.record_deleted?args=5</nowiki></tt>, when the user's language is Spanish.
:<syntaxhighlight lang="xml" enclose="div">
:<syntaxhighlight lang="xml" enclose="div">
<platform>
<platform>

Revision as of 20:40, 16 June 2011

Get translated strings using the REST API.

Learn more: REST API Conventions and Considerations.

Requirements

Get a Translation for a Custom Label

Method
GET
URI
https://{domain}/networking/rest/translationWorkBench/customlabel/{key}
https://{domain}/networking/rest/translationWorkBench/customlabel/{key}?args=param1,...
where:
  • {key} - The index value used to look up a translated string, in the form {category}.{token_id}
Query Parameters
  • args - A list of one or more arguments that will be interpolated into the string at the locations assigned to them when the base string was created.
For more information, see: Specifying Query Parameters in REST APIs
Response
This sample response comes in reply to the request, http://{domain}/networking/rest/translationWorkBench/customlabel/validation.record_deleted?args=5, when the user's language is Spanish.
<platform>
    <translationWorkBench>
        <key>validation.record_deleted</key>
        <translatedText>5 registros eliminados con éxito</translatedText>
    </translationWorkBench>

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Fields

Name Type Description
key String The ID of the translated element, in the form {category}.{token_id}. For example: validation.record_deleted
translatedText String The translation for the key, in the current user's language, with any arguments in the request interpolated into the string.