VersionOne Localization Application Programming Interface (API)
Localization allows a client to retrieve the suggested localization
of a specific string or word. Often other VersionOne APIs will
return unlocalized strings such as suggested names or error
messages. These unlocalized strings may be passed to the
Localization API which will attempt to translate the string into a
locale specific string.
In a case where a locale specific string could not be found, a
series of fallbacks exist. For example if French-Canadian (fr-ca)
does not have a localization entry for the string "Story", the
French locale (fr) will be searched, and then finally the English
(en) locale will be searched. If no localization entry exists in any
locale, the input string will be returned unchanged.
To retrieve a localized string for a specific locale, set the
"Accept-Language" HTTP Header in the request to a specific locale.
For example to use French-Canadian set the header to "fr-ca".
Responses are always returned with a content type of "text/plain".
Unlike other VersionOne API implementations, the localization API
does not require authentication of any kind.
When a request results in an error, the response will have an HTTP
status code in the range 400-500, and detailed information about the
error will be returned in the response payload.
Common Error Status Codes
400 Bad Request.Â
A 400 status code is the most common error, resulting from a
request that could not be processed by the API. The Error Message
will identify the specific problem, and there may be Exception
elements that give very detailed information. The usual causes of
this error is an invalid or missing parameter on the query string.
405 Method Not Allowed.Â
A 405 status code indicates that the HTTP method used for
the request is not valid at the requested URL. This will be returned
for any method other than GET and POST, or if POST was sent to a URL
that does not support updating.
500 Internal Server Error.Â
A 500 status code indicates that an unexpected error
occurred during the processing of the request. The response payload
will contain Exception elements with specific information that will
help technical diagnose the cause of the error. This could be due
to:
An
environmental problem (e.g., the database is unavailable).
An unhandled exception within the VersionOne software.
The localization API has the following syntax:
http://localhost/VersionOne/loc.v1?tag
Where tag is the string or word to be localized. Notice that the tag
is not used like a normal query parameter where the name and value
are seperated by an equals sign. The entire contents of the query
string after the question mark is localized.
The following example will retrieve the name to display when showing
the Story.Name attribute for a given Story asset.
http://localhost/VersionOne/loc.v1?AttributeDefinition'Name'Story
Title
The response contains the word
"Title" which directly corresponds to the field label used in
the VersionOne applicaton.
The following example will retrieve the name of the Scope asset type
to display when showing a Scope asset.
http://localhost/VersionOne/loc.v1?Scope
Project
Note that Scope is the internal
VersionOne name for a project, sub-project, or release.
Copyright © 2007, VersionOne, LLC. All rights reserved. This document
was generated 2007-03-29Â 14:05:05.