Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Dell Unity™ Family Unisphere® Management REST API Programmer's Guide

PDF

Localizing response text

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
Response
{
   "@base": "https://10.6.7.41/api/types/alert/instances?fields=message,component,messageId,severity,resolution,timestamp, description&compact=true",
   "updated": "2014-01-16T03:08:53.889Z",
   "links": [
       {
           "rel": "self",
           "href": "&page=1"
       },
       {
           "rel": "next",
           "href": "&page=2"
       },       
   ],
   "entries": [
       {
           "content": {
               "message": "ストレージ システムのライト キャッシュが無効になっています。",
               "id": 5962,
               "component": "AlertRaidppSources",
               "messageId": "29199",
               "severity": 4,

               "resolution": "ライト キャッシュにシステム メモリが配置されていることと、ライト キャッシュが有効になっていることを確認します。 また、SPSがAC電源に接続され、ストレージ システムとSPSの間のシリアル通信ケーブルが正しく接続されていることも確認してください。 障害が発生しているハードウェア コンポーネントがあれば取り替えて、障害が解決された後でライト キャッシュが自動的に有効になるまで数分間待ちます。 問題が解決しない場合は、サービス プロバイダにお問い合わせください。",
               "timestamp": "2013-12-11T21:54:44.000Z",
               "description": "ストレージ システムのライト キャッシュが構成されていないか、ハードウェア コンポーネントまたはソフトウェアに問題があるため無効になっています。"
           }
       }
   ]
}
.
.
.

Example 2: Using the language request parameter to localize

The following request yields the same response as the previous example.

Request Header
Accept: application/json
Request
GET https://10.6.7.41/api/types/alert/instances?fields=message,component,messageId,severity,resoultion, timestamp&compact=true &language=ja-JP

Rate this content

Accurate
Useful
Easy to understand
Was this article helpful?
0/3000 characters
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please select whether the article was helpful or not.
  Comments cannot contain these special characters: <>()\