Lokalise APIv2 Elixir SDK

Elixir interface for the Lokalise APIv2.

View the Project on GitHub lokalise/elixir-lokalise-api




Custom translation statuses

Custom translation statuses must be enabled for the project before using this endpoint! It can be done in the project settings.

Fetch translation statuses

Doc

{:ok, statuses} = ElixirLokaliseApi.TranslationStatuses.all(project_id, page: 2, limit: 1)

status = hd(statuses.items)
status.status_id

Fetch a single translation status

Doc

{:ok, status} = ElixirLokaliseApi.TranslationStatuses.find(project_id, status_id)

status.status_id

Create translation status

Doc

data = %{
  title: "elixir",
  color: "#344563"
}

{:ok, status} = ElixirLokaliseApi.TranslationStatuses.create(project_id, data)

status.title

Update translation status

Doc

data = %{
  title: "elixir-upd"
}

{:ok, status} = ElixirLokaliseApi.TranslationStatuses.update(project_id, status_id, data)

status.title

Delete translation status

Doc

{:ok, resp} = ElixirLokaliseApi.TranslationStatuses.delete(project_id, status_id)

resp.custom_translation_status_deleted

Supported color codes for translation statuses

Doc

As long as Lokalise supports only very limited array of color hexadecimal codes for custom translation statuses, this method can be used to fetch all permitted values.

{:ok, resp} = ElixirLokaliseApi.TranslationStatuses.available_colors(project_id)

resp.colors