REST API national language support
The REST API supports, with certain qualifications, the ability to specify national languages as part of an HTTP request.
Background
HTTP headers allow particular behavior to be specified on requests and additional information to be provided in responses.
Included in the HTTP headers is the ability to request that information is returned in a national language. The REST API honors this header where possible.
Specifying a national language
In the ACCEPT-LANGUAGE HTTP header, one or more language tags can be supplied. You can optionally associate a rank with the tags, allowing for the specification of a list ordered by preference. This page has a helpful discussion of the principle.
The REST API honors this header, selecting a language from the ACCEPT-LANGUAGE header and returning messages in that language. When the ACCEPT-LANGUAGE header contains no language that the REST API can support, messages are returned in a default language. This default language corresponds to the default locale of the REST API web server.
The What data is translated? section explains what data is translated.
Indicating the applicable language on responses
The CONTENT-LANGUAGE HTTP header on responses from the REST API indicates the language in which the messages are returned.
What data is translated?
- Data that is returned from a queue manager is not translated - for example in the case of executing an MQSC command via the REST API, the queue manager's responses are in the locale of the queue manager.
- The generated (Swagger) documentation for the REST API, as exposed via the
apiDiscovery
feature, is in English.
What languages are supported?
- Chinese(Simplified)
- Denoted by the language tag
zh_CN
- Chinese(Traditional)
- Denoted by the language tag
zh_TW
- Czech
- Denoted by the language tag
cs
- French
- Denoted by the language tag
fr
- Hungarian
- Denoted by the language tag
hu
- Italian
- Denoted by the language tag
it
- Japanese
- Denoted by the language tag
ja
- Korean
- Denoted by the language tag
ko
- Polish
- Denoted by the language tag
pl
- (Brazilian) Portuguese
- Denoted by the language tag
pt_BR
- Russian
- Denoted by the language tag
ru
- Spanish
- Denoted by the language tag
es
Examples
In the examples, the web server has an English default locale.
- Specifying a single supported language
- In the request headers,
ACCEPT-LANGUAGE
is set tofr
. This setting specifies that French is the preferred language for translatable text. - Specifying a list of languages
- In the request headers,
ACCEPT-LANGUAGE
is set toam, fr
. This setting specifies that Amharic and French are acceptable languages for translatable text and that Amharic is the preferred language for translatable text. - Specifying a single unsupported language
- In the request headers,
ACCEPT-LANGUAGE
is set toam
. This setting specifies that Amharic is the preferred language for translatable text.