LocalizationsResource

Manages localization strings.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.24+fa54770
public final class LocalizationsResource

Manages localization strings. Get it from Ovok.localizations().

Methods

i18next

public LocalizationsResource.I18next i18next()

Returns the i18next document routes.

Returns: the i18next routes

list

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

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

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

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

public static final class I18next

Reads and patches a language as one i18next document.

I18next.retrieve

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

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

Last updated on

On this page