loc.v1
loc.v1 translates a single input to a localized string. As such, it is recommended to use loc-2.v1 since it support single values as well as bulk translations.
This endpoint provides localization and allows a client to retrieve the suggested localization of a specific string or word. Often other Digital.ai Agility endpoints will return unlocalized strings such as suggested names or error messages. These unlocalized strings may be passed to loc.v1 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".
URL Form | <Server Base URI>/loc.v1?<localizable_string> |
Authentication | None |
HTTP Request Verb | HTTP GET |
Response Content Type | text/plain |
API
Request Parameters
localizable_string
Examples
An Asset Type
The following example will retrieve the name of the Scope
asset type to display when showing a Scope
asset.
<Server Base URI>/loc.v1?Scope
The response is as follows.
Project
Scope is the internal VersionOne name for a project, sub-project, or release.
An Attribute Definition
The following example will retrieve the name to display when showing the Story.Name
attribute for a given Story
asset.
<Server Base URI>/loc.v1?AttributeDefinition'Name'Story
The response is as follows.
Title
The response contains the word "Title" which directly corresponds to the field label used in the Agility application.