Add a new project locale
POST https://localise.biz/api/locales
Adds a new locale to the currently authenticated project.
If the locale is created successfully the response will be 201 (created).
If the locale already exists the response will be 409 (conflict).
URI parameters
key
|
API key - required if not sent in Authorization header |
string | optional |
POST parameters
code
|
Short code, or language tag for new locale |
string | required |
Request headers
Authorization
|
API key sent as |
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
}
}