Message files provide localized text for certain attribute values in Task and Event objects.
Each file in a localization bundle can include an arbitrary number of lines. Each line must have the following form, where key is any of the values that the service might assign to one of its service-specific Task or Event elements and value is the localized string to display.
key=value
The value string can contain parameters that provide the resourceId, resourceName, and resourceType of the subject of the Task or Event.
The following restrictions apply to each message file in a localization bundle:
Whenever a localizable attribute appears in a log message, vCloud Director takes the following steps to find text to display:
A Task or Event that a service posts can also include a passthrough key=value pair that is always displayed as posted by the service, regardless of the current client locale or the presence or absence of a localization bundle.
Message file contents (key=value pairs) apply to all Task and Event objects that the service creates. If a Task and an Event both use the same key, the same message appears for both.
To create a message that appears only when a Task has status="running", append the string _PROGRESS to the key.
To create a message that appears only for a failed Event (one where success="false"), prepend the string FAILED. to the key.
The following lines are appropriate in the en_US message file for a service that meets the following conditions:
■
| |
■
|
It defined a Task whose operationName attribute can have a value of backupInProgress. |
■
|
It defined an Event whose type attribute can have a value of backupComplete. |
org.example.vcd.backup=vCloud Backup Service backupInProgress=Backup in progress for ${resourceName} ({resourceType}) with id: {resourceId} backupInProgress_PROGRESS=Backup in progress for ${resourceName} ({resourceType}) with id: {resourceId} backupComplete=Backup complete for entity {resourceName} ({resourceType}) with id: {resourceId} FAILED.backupComplete=Backup failed for entity {resourceName} ({resourceType}) with id: {resourceId}
If the localization bundle for this service contained a file named fr_FR that included the following line, the Task posted in Example: Add a Task to an Organization's Tasks List returns this localized value for the operationName attribute when the client locale is set to fr_FR. The passthrough value for operation is not localized.
backupInProgress_PROGRESS=Sauvegarde en cours pour entity {resourceName} ({resourceType}) avec id: {resourceId}
GET https://vcloud.example.com/api/task/604
200 OK Content-Type: application/vnd.vmware.vcloud.task+xml ... <Task ... operation="Backup in progress for virtual machine with id 7b91b053-2b..." operationName="Sauvegarde en cours pour entity Finance (application/vnd.vmware.vcloud.org+xml) avec id 26 " ... >