WoodWing Help Center

Elvis 6 REST API - localization

Elvis 6 REST API - localization

GET/POST

http://yourserver.com/services/messages
    ?localeChain=<comma-delimited locales>
    &ifModifiedSince=<last time the messages were requested>
    &bundle=<requested bundle>

What does it do?

Retrieve message bundles from the Elvis server.

Allows localization of a custom plug-in using messages available on the server. The messages from the Pro client acm can be used in your own plug-in. It is also possible to use any custom messages defined in the Config/messages folder.

The common message bundle cmn is always returned and merged with the requested bundle. The common bundle contains messages for relations, metadata fields, metadata groups and metadata values. The common message keys have the following structure:

  • Relations:

relation.[relation type].label

  • Metadata fields:

field_label.[field name]

  • Metadata groups:

field_group_label.[group name]

  • Metadata values:

field_value_label.[field name].[value]

For a full list of available messages see Translating clients.

Parameters

localeChain

Comma separated list of locales, the first supplied locale is leading. If a message is missing for a locale it will fall back to the next locale in the chain for that message.

Optional. Default is the preferred locale configured on the server, with a fallback to en_US.

ifModifiedSince

The date of the last requested cached messages, specified in milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.

Use this when caching the messages in your client locally. The messages will only be returned if the messages have been modified on the server since the supplied date. If no new messages are available a 304 http response is returned

Optional. When this parameter is omitted, the messages will always be returned.

bundle

The bundle to return, can be either web or acm. The cmn bundle will always be returned combined with the requested bundle.

Optional. Default is web.

Return value

The service returns a flat JSON response containing all keys and messages.

{
  "field_label.section":"Section",
  "field_label.problems":"Problems", 
  ... 
  "field_label.ocPublishedMedium":"Published medium",
  "field_value_label.genre.79":"Hard Rock"
}

Examples

Request English messages bundle

messages

http://demo.elvisdam.com/services/messages
?localeChain=en_US
&ifModifiedSince=1349180122000
&bundle=acm
{
  "field_label.problems":"Problems",
  "view.controls.SelectFieldDialog.no_description_field_label":"There is no description available for  this field.", 
  ... 
  "field_value_label.genre.77":"Musical",
  "field_value_label.genre.79":"Hard Rock"
}

Different locale chain

messages
http://demo.elvisdam.com/services/messages
?localeChain=nl_NL,en_US
&ifModifiedSince=1349180122000
&bundle=acm
{
  "field_label.problems":"Probleem",
  "view.controls.SelectFieldDialog.no_description_field_label":"Er is geen beschrijving beschikbaar voor dit veld.",
  ... 
  "field_value_label.genre.77":"Musical",
  "field_value_label.genre.79":"Hard Rock"
}

Not modified since specified date

messages
http://demo.elvisdam.com/services/messages
?localeChain=en_US
&ifModifiedSince=1349180122000
&bundle=acm
{
  "errorcode" : 304,
  "message" : ""
}
Was this article helpful?
0 out of 0 found this helpful / Created: / Updated:
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.