Difference between revisions of "REST API:translationWorkbench Resource"

From LongJump Support Wiki
imported>Aeric
imported>Aeric
Line 33: Line 33:
| form || <tt>{object_name}.{sub_type}.{layout_name}</tt>. For example, Customers.RelatedInformationSection.DefaultLayout.
| form || <tt>{object_name}.{sub_type}.{layout_name}</tt>. For example, Customers.RelatedInformationSection.DefaultLayout.
|-  
|-  
| globalpicklist || {{TBD|The "name" column in the GUI shows the picklist name, rather than display label names. Should it be showing the latter? Should the format be <tt>{picklist_name}.{label_name}</tt>? For example: <tt>accountRating.active</tt> -- or <tt>AccountRating.active</tt>?}}
| 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>.
| homepage || <tt>{application_name}.{sub_type}</tt>, where <tt>{sub_type}</tt> is either <tt>label</tt> or <tt>widgetTitle</tt>.

Revision as of 01:21, 16 June 2011

Get translated strings using the REST API.

Learn more: REST API Conventions and Considerations.

Requirements

Get a Translation

Method
GET
URI
https://{domain}/networking/rest/translationWorkBench/{elem}/{key}
https://{domain}/networking/rest/translationWorkBench/{elem}/{key}?args=param1,...
where:
  • {elem} - Is the internal name for one of the Translation Workbench elements
  • key - Is the index value used to look up a translated string
The possible values are shown in this table:
Element Key Format
action {object_name}.{action_name}
application {application_name}.{sub_type}, where {sub_type} is either label or widgetTitle.
customlabel {category}.{token_id}
enumeratedfield {object_name}.{enumerated_field_name}
field {object_name}.{field_name}
form {object_name}.{sub_type}.{layout_name}. For example, Customers.RelatedInformationSection.DefaultLayout.
globalpicklist __TBD: which name to use in the GUI__
homepage {application_name}.{sub_type}, where {sub_type} is either label or widgetTitle.
object {object_name}
reportfolder report_name
report report_name
sidebar {sub_type}.{name}, where {sub_type} is either label or widgetTitle.
validation {object_name}.{validation_message_name}
view {view_type}.{object_name}.{label_name}, where {view_type} is one of objectRelatedViews or otherViews.
webtab {sub_type}.{name}, where {sub_type} is either label or widgetTitle.
workflow {object_name}.{workflow_name}.{label_name}
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://localhost/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.