For requests that result in localizable resources, such as response body text, events, alerts, and error messages, the locale specified in the request determines the localization language for the response. If the requested dialect is not available, the API tries to match matches on the language, alone. For example,
de-AA will match with
de-DE, if
de-AA is not available. If the API cannot find a match, it uses
en-US (American English) instead of returning an error message.
By default, REST API responses are in locale en-US. To request the localization of response text to other locales, use one of the following request components:
Accept-language request header. (Some browsers and other clients set this header automatically.)
language request parameter, as described in the Request parameters topic. This parameter overrides the
Accept-Language request header.
Considerations for localizing response text
The following considerations apply to localizing response text in the REST API:
Support for locales other than
en-US requires the installation of language packs.
If the requested locale is not available, the API defaults to
en-US instead of returning an error message.
All time values are supplied in Coordinated Universal Time (UTC) format.
The
language request parameter is useful for testing from a plain browser or from an environment where headers are inconvenient.
Example 1: Using the Accept-language request header to localize
The following request returns the
alert resource instances and specifies that the response be localized to Japanese.
Request Header
Accept: application/json
Accept-language:ja-JP
Request
GET https://10.6.7.41/api/types/alert/instances?fields=message,component,messageId,severity,resolution,timestamp,description&compact=true