Read a language code
get
/content/management/api/v1.1/l10n/languageCodes/{code}
Read a language by code.
Request
Path Parameters
-
code: string
Code of the language. This is case sensitive
Query Parameters
-
lang(optional): string
Language value in which we can expect all locales informationDefault Value:
en-US -
links(optional): string
This parameter accepts a comma-separated list of link names. By default, this parameter gives all the links applicable. Possible values are: self, canonical, describedby
Response
Supported Media Types
- application/json
200 Response
OK.
Root Schema : LanguageBean
Type:
Show Source
object-
code(optional):
string
locale code
-
createdBy(optional):
string
Created by.
-
createdDate(optional):
object date
date
-
description(optional):
string
Locale description
-
language(optional):
string
Locale language
-
languageType(optional):
string
lindicates if this is custom locale or default locale
-
links(optional):
array links
-
script(optional):
string
Script from language code
-
territory(optional):
string
Language code territory
-
updatedBy(optional):
string
Updated by.
-
updatedDate(optional):
object date
date
Nested Schema : Link
Type:
objectLink of the resource.
Show Source
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
304 Response
Not modified.
400 Response
Bad request.
404 Response
Not found.
500 Response
Internal server error.
Examples
The following example shows how to read a language by code by submission of a GET request on the REST resource using cURL:
curl -X GET -H 'Accept: application/json' 'https://host:port/content/management/api/v1.1/l10n/languageCodes/{code}'
Example 1:
This reads a language code with code:en-x-my-custom-subtag./content/management/api/v1.1/l10n/languageCodes/en-x-my-custom-subtag
Response Body
{
"code": "en-x-my-custom-subtag",
"language": "English",
"description": "en-x-my-custom-subtag description",
"territory": null,
"script": null,
"languageType": "custom",
"createdBy": "swebcli.SitesAdmin1.admin",
"createdDate": {
"value": "2020-04-30T18:37:20.671Z",
"timezone": "UTC"
},
"updatedBy": "swebcli.SitesAdmin1.admin",
"updatedDate": {
"value": "2020-04-30T18:37:20.671Z",
"timezone": "UTC"
},
"links": [
{
"href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/l10n/languageCodes",
"rel": "self",
"method": "POST",
"mediaType": "application/json"
},
{
"href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/l10n/languageCodes",
"rel": "canonical",
"method": "POST",
"mediaType": "application/json"
},
{
"href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/metadata-catalog/l10n/languageCodes",
"rel": "describedby",
"method": "GET",
"mediaType": "application/schema+json"
}
Example 2:
This reads a language code with code:ar and returns language in en-US.
/content/management/api/v1.1/l10n/languageCodes/az-Cyrl-AZ
{
"code": "az-Cyrl-AZ",
"language": "Azerbaijani",
"description": "",
"territory": "Azerbaijan",
"script": "Cyrillic",
"languageType": "default",
"createdBy": "system",
"createdDate": {
"value": "1970-01-18T04:00:28.800Z",
"timezone": "UTC"
},
"updatedBy": "system",
"updatedDate": {
"value": "1970-01-18T04:00:28.800Z",
"timezone": "UTC"
},
"links": [
{
"href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/l10n/languageCodes/az-Cyrl-AZ",
"rel": "self",
"method": "GET",
"mediaType": "application/json"
},
{
"href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/l10n/languageCodes/az-Cyrl-AZ",
"rel": "canonical",
"method": "GET",
"mediaType": "application/json"
},
{
"href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/metadata-catalog/l10n/languageCodes/az-Cyrl-AZ",
"rel": "describedby",
"method": "GET",
"mediaType": "application/schema+json"
}
Example 3:
This reads a language code with code:ar and returns language in Arabic.
/content/management/api/v1.1/l10n/languageCodes/ar?lang=ar
{
"code": "ar",
"language": "??????????????",
"description": "",
"territory": null,
"script": null,
"languageType": "default",
"createdBy": "system",
"createdDate": {
"value": "1970-01-18T04:00:28.800Z",
"timezone": "UTC"
},
"updatedBy": "system",
"updatedDate": {
"value": "1970-01-18T04:00:28.800Z",
"timezone": "UTC"
},
"links": [
{
"href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/l10n/languageCodes/ar?lang=ar",
"rel": "self",
"method": "GET",
"mediaType": "application/json"
},
{
"href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/l10n/languageCodes/ar?lang=ar",
"rel": "canonical",
"method": "GET",
"mediaType": "application/json"
},
{
"href": "http://swebcli-oracle.testec.cec.oraclecorp.com:8080/content/management/api/v1.1/metadata-catalog/l10n/languageCodes/ar",
"rel": "describedby",
"method": "GET",
"mediaType": "application/schema+json"
}
]
}