# Write i18next resources for a language

Canonical page: https://docs.ovok.com/api/localization-keys/write-i18next-resources-for-a-language

`PATCH /localization/i18next/{language}`

Writes many localizations of one language at once from a nested i18next resource object. The write runs in the background.

**Auth:** bearer token.
**Scope:** the caller's project (from the token). Localizations are read and written with your token.

## Behaviour

- `language` must be one of the languages in your project's locale settings (`GET /locales`).
- The body is a nested object. Keys may contain only letters, digits, `_` and `-`; nesting builds dot-separated keys. Each value is either a string of 1 to 4,096 characters or another nested object.
- Keys in the body are created or overwritten. Keys that are not in the body are not changed. Nothing is deleted.
- The route answers `202 Accepted` with no body as soon as the job is queued. The values are written by a background job, and the cache for the language is cleared when it finishes.
- A second background job per project language creates AI translations of the default-language values for keys that have no translation in that language yet. Existing translations are not changed.

## Example

```bash
curl -X PATCH 'https://api.sandbox.ovok.com/localization/i18next/en-US' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' \
  -d '{ "home": { "title": "Home", "subtitle": "Welcome back" } }'
```
