# LocalizationsResource

Canonical page: https://docs.ovok.com/java-sdk/reference/localizations-resource

```java
public final class LocalizationsResource
```

Manages localization strings. Get it from [`Ovok.localizations()`](/java-sdk/reference/ovok#localizations).

## Methods [#methods]

### i18next [#i18next]

```java
public LocalizationsResource.I18next i18next()
```

Returns the i18next document routes.

**Returns:** the i18next routes

### list [#list]

```java
public JsonNode list(
        String language,
        Map<String, ?> query,
        RequestOptions options) throws IOException, InterruptedException
```

Lists a language's strings (`GET /localization/{language}`).

**Parameters:**

- `language`: the language code
- `query`: query parameters, sent as given
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### retrieve [#retrieve]

```java
public JsonNode retrieve(
        String language,
        String key,
        RequestOptions options) throws IOException, InterruptedException
```

Reads one string (`GET /localization/{language}/{key}`).

**Parameters:**

- `language`: the language code
- `key`: the localization key
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### update [#update]

```java
public JsonNode update(
        String language,
        String key,
        Object body,
        RequestOptions options) throws IOException, InterruptedException
```

Replaces one string (`PUT /localization/{language}/{key}`).

**Parameters:**

- `language`: the language code
- `key`: the localization key
- `body`: the new value
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### delete [#delete]

```java
public void delete(
        String language,
        String key,
        RequestOptions options) throws IOException, InterruptedException
```

Deletes one string (`DELETE /localization/{language}/{key}`).

**Parameters:**

- `language`: the language code
- `key`: the localization key
- `options`: per-request options, such as the timeout

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

## LocalizationsResource.I18next [#localizationsresourcei18next]

```java
public static final class I18next
```

Reads and patches a language as one i18next document.

### I18next.retrieve [#i18nextretrieve]

```java
public JsonNode retrieve(
        String language,
        RequestOptions options) throws IOException, InterruptedException
```

Reads a language as an i18next document (`GET /localization/i18next/{language}`).

**Parameters:**

- `language`: the language code
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### I18next.update [#i18nextupdate]

```java
public void update(
        String language,
        Object document,
        RequestOptions options) throws IOException, InterruptedException
```

Patches a language's i18next document (`PATCH /localization/i18next/{language}`).

**Parameters:**

- `language`: the language code
- `document`: the keys to change
- `options`: per-request options, such as the timeout

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response
