Unicat API Reference

Up - API Reference - Home


/api/p/<project gid>/languages/add

Requires JWT.

Add a localization to a project

You can only add from the predefined global languages list, see /api/languages/get.

Request

POST /api/p/<project gid>/languages/add
Authorization: Bearer <JWT>

{
    "language": "de"
}

Note: the language must be given in lower-case, always

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "project": "<project gid>"
    },
    "data": {
        "cc.projects": {
            "<project gid>": {
                "name": "Project Name",
                "status": "active",
                
            }
        },
        "definitions": {
            "<definition gid>": {
                ,
                "label": {
                        "en": "Base",
                        "nl": "Basis",
                        "de": "Base"
                    },
                
                },
            
        },
        "classes": {},
        "fields": {},
        "layouts": {},
    }
}

result

project is the current project.

data

cc.projects is a dictionary with the current project.

definitions is a dictionary holding all definitions for the project.
classes is a dictionary holding all classes for the project.
fields is a dictionary holding all fields for the project.
layouts is a dictionary holding all layouts for the project.

Note that all localized properties have an extra key for the added language. The value is based on the closest matching language from the project. For nl-be this would be nl, and for de this is en (the default).

Error responses

400 Bad request - missing parameters or wrong type or value
401 Unauthorized - missing or expired JWT
403 Forbidden - not a member of this project
422 Unprocessable entity - cannot perform update