Main menu

Modify a project locale

PATCH https://localise.biz/api/locales/{locale} 

Modifies the properties of a locale in the currently authenticated project.

The full, modified locale object is returned.

URI parameters

locale

Locale short code, or language tag

string required
key

API key - required if not sent in Authorization header

string optional

Request body

The PATCH request body must contain (object) Partial locale data to update.

This must be a JSON-encoded string in the following form:

{
    "code": "", // Locale short code
    "name": "", // Friendly display name
} 

Loco's official SDK binds the request body to the "data" parameter. Check the documentation for other libraries.

Request headers

Authorization

API key sent as "Loco <key>" or "Basic <encoded>". See Authentication.

string required if not in query

Response

A single JSON-encoded Locale object, which takes the following form:

{
    "code": "", // Locale short code, or language tag
    "name": "", // Friendly display name
    "source": false, // Whether the default/source locale of the project
    "plurals": {
        "length": 2, // Number of forms including singular
        "equation": "n != 1", // Equation for calculating offset in forms
        "forms": ["zero","one","two","few","many","other"], // Plural form names
    },
    "progress": {
        "translated": 0, // Number of assets for which a translation exists (including those flagged)
        "untranslated": 0, // Number of assets that are not yet translated to this language
        "flagged": 0, // Number of translations that are flagged as requiring attention
        "words": 0, // Approximate word count for translated texts in this language
    }
}  

Try it

Open in test console »


« /api/locales