- Home
- Resources
- I18nResource
Resource to translate given keys (optionally including parameters)
GET /i18n/get
Get the current session language
Response Body
media type |
data type |
description |
application/json;charset=UTF-8 |
(custom)
|
session language |
application/xml;charset=UTF-8 |
(custom)
|
Example
Request
GET /i18n/get
Accept: application/json;charset=UTF-8
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
...
POST /i18n/set
Set the current session language
Request Body
media type |
data type |
description |
application/json |
SetLanguageRequest
(JSON) |
request to set the current session language |
Response Body
media type |
data type |
description |
application/json;charset=UTF-8 |
(custom)
|
response |
application/xml;charset=UTF-8 |
(custom)
|
Example
Request
POST /i18n/set
Content-Type: application/json
Accept: application/json;charset=UTF-8
{
"code" : "..."
}
Response
HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
...
GET /i18n/t
Translate the given key and optional parameters (variant with key given as query parameter)
Request Parameters
name |
type |
description |
multivalued |
k |
query |
translation key |
no |
p |
query |
optional parameters |
yes |
Response Body
media type |
data type |
description |
text/plain;charset=UTF-8 |
(custom)
|
translated string |
Example
Request
GET /i18n/t
Accept: text/plain;charset=UTF-8
Response
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
...
GET /i18n/t/{key}
Translate the given key and optional parameters (variant with key given in the path)
Request Parameters
name |
type |
description |
multivalued |
key |
path |
translation key |
no |
p |
query |
optional parameters |
yes |
Response Body
media type |
data type |
description |
text/plain;charset=UTF-8 |
(custom)
|
translated string |
Example
Request
GET /i18n/t/{key}
Accept: text/plain;charset=UTF-8
Response
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
...