Languages Resource

GET /locales

Retrieves a full list of locales enabled in Zanata.

Request Parameters
name type description default constraints
filter query    
page query 1 int
sizePerPage query 10 int
sort query    
Response Codes
code condition
500 If there is an unexpected error in the server while performing this operation
Response Body
media type data type description
application/json object (JSON) The following response status codes will be returned from this operation:
OK(200) - Response containing a full list of locales.

Example

Request
GET /locales
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

PUT /locales/locale

Create a new language in Zanata

Request Body
media type data type
application/json Locale Details (JSON)
Response Codes
code condition
500 If there is an unexpected error in the server while performing this operation
Response Body
media type data type description
application/json Locale Details (JSON) The following response status codes will be returned from this operation:
OK(201) - Locale is added.
OK(200) - Locale is already exist.

Example

Request
PUT /locales/locale
Content-Type: application/json
Accept: application/json

                
{
  "localeId" : "es-ES",
  "displayName" : "Spanish (Spain)",
  "alias" : "es",
  "nativeName" : "Español",
  "enabled" : true,
  "enabledByDefault" : true,
  "pluralForms" : "nplurals=2; plural=(n != 1)",
  "rtl" : true
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "localeId" : "es-ES",
  "displayName" : "Spanish (Spain)",
  "alias" : "es",
  "nativeName" : "Español",
  "enabled" : true,
  "enabledByDefault" : true,
  "pluralForms" : "nplurals=2; plural=(n != 1)",
  "rtl" : true
}
                
              

GET /locales/new

Retrieves a list of locales that is not added yet in the server.

Request Parameters
name type description default constraints
filter query    
size query 10 int
Response Codes
code condition
500 If there is an unexpected error in the server while performing this operation
Response Body
media type data type description
application/json array of Locale Details (JSON) The following response status codes will be returned from this operation:
OK(200) - Response containing a list of locales.

Example

Request
GET /locales/new
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "localeId" : "es-ES",
  "displayName" : "Spanish (Spain)",
  "alias" : "es",
  "nativeName" : "Español",
  "enabled" : true,
  "enabledByDefault" : true,
  "pluralForms" : "nplurals=2; plural=(n != 1)",
  "rtl" : true
} ]
                
              

GET /locales/source

Returns list of active source locales of all documents for all active projects. Restricted to admin

Response Codes
code condition
200 Content contains a list of source locale details
500 If there is an unexpected error in the server while performing this operation
Response Body
media type data type description
application/json array of SourceLocaleDetails (JSON) OK 200 containing the list of SourceLocaleDetails

Example

Request
GET /locales/source
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "docCount" : 12345,
  "localeDetails" : {
    "localeId" : "es-ES",
    "displayName" : "Spanish (Spain)",
    "alias" : "es",
    "nativeName" : "Español",
    "enabled" : true,
    "enabledByDefault" : true,
    "pluralForms" : "nplurals=2; plural=(n != 1)",
    "rtl" : true
  }
} ]
                
              

GET /locales/ui

Retrieves a full list of localized locales for server.

Response Codes
code condition
500 If there is an unexpected error in the server while performing this operation
Response Body
media type data type description
application/json array of Locale Details (JSON) The following response status codes will be returned from this operation:
OK(200) - Response containing a full list of locales.

Example

Request
GET /locales/ui
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "localeId" : "es-ES",
  "displayName" : "Spanish (Spain)",
  "alias" : "es",
  "nativeName" : "Español",
  "enabled" : true,
  "enabledByDefault" : true,
  "pluralForms" : "nplurals=2; plural=(n != 1)",
  "rtl" : true
} ]
                
              

DELETE /locales/locale/{localeId}

Delete a locale in Zanata

Request Parameters
name type description
localeId path
Response Codes
code condition
500 If there is an unexpected error in the server while performing this operation
Response Body
media type data type description
application/json object (JSON) The following response status codes will be returned from this operation:
OK(200) - Locale is deleted.

Example

Request
DELETE /locales/locale/{localeId}
Accept: application/json

              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...
                
              

GET /locales/locale/{localeId}

Retrieve locale details

Request Parameters
name type description
localeId path
Response Codes
code condition
500 If there is an unexpected error in the server while performing this operation
Response Body
media type data type
application/json Locale Details (JSON)

Example

Request
GET /locales/locale/{localeId}
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "localeId" : "es-ES",
  "displayName" : "Spanish (Spain)",
  "alias" : "es",
  "nativeName" : "Español",
  "enabled" : true,
  "enabledByDefault" : true,
  "pluralForms" : "nplurals=2; plural=(n != 1)",
  "rtl" : true
}
                
              

GET /locales/locale/{localeId}/members

Retrieve locale member list

Request Parameters
name type description
localeId path
Response Codes
code condition
500 If there is an unexpected error in the server while performing this operation
Response Body
media type data type
application/json array of LocaleMember (JSON)

Example

Request
GET /locales/locale/{localeId}/members
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "username" : "...",
  "isCoordinator" : true,
  "isReviewer" : true,
  "isTranslator" : true
} ]