# ovok.locales and ovok.localizations

Canonical page: https://docs.ovok.com/web-sdk/core/namespaces/localization

`ovok.locales` holds the project's list of supported languages and its default language. `ovok.localizations` holds the translation entries for each language. Both are admin tools: call them from a console or a server client with the right project role, not from a patient app.

## Set the supported languages [#set-the-supported-languages]

```ts
const locales = await ovok.locales.retrieve();

await ovok.locales.update({
  languages: ['en', 'de', 'fr'],
  defaultLanguage: 'en',
});
```

- `update` sends a `PATCH` and resolves to the saved locales.

## Read and edit translation entries [#read-and-edit-translation-entries]

Entries are keyed by language and translation key.

```ts
const { total, resources } = await ovok.localizations.list('de', { search: 'welcome', _count: 20 });

const entry = await ovok.localizations.retrieve('de', 'home.welcome');

await ovok.localizations.update('de', 'home.welcome', { value: 'Willkommen' });
await ovok.localizations.delete('de', 'home.welcome');
```

- `list` resolves to one page, `{ total, resources }`. Page with `_count` and `_offset`.
- `update` sets the entry with a `PUT`, so it creates a missing key.

## Work with i18next documents [#work-with-i18next-documents]

`ovok.localizations.i18next` reads and writes a whole language as one i18next document, so a client can load all strings in one request.

```ts
const document = await ovok.localizations.i18next.retrieve('de');

await ovok.localizations.i18next.update('de', { home: { welcome: 'Willkommen' } });
```

- `update` patches the document. The server queues the write (202), so a read right after may not show it yet.
- Values are text or nested objects.

## Reference [#reference]

- [localization API reference](/web-sdk/core/reference/core/localization): every method and type.
- [Errors and retries](/web-sdk/core/errors-and-retries)
- [ovok.projects](/web-sdk/core/namespaces/projects) for project settings and features.
