Elixir interface for the Lokalise APIv2.
View the Project on GitHub lokalise/elixir-lokalise-api
Custom translation statuses must be enabled for the project before using this endpoint! It can be done in the project settings.
{:ok, statuses} = ElixirLokaliseApi.TranslationStatuses.all(project_id, page: 2, limit: 1)
status = hd(statuses.items)
status.status_id
{:ok, status} = ElixirLokaliseApi.TranslationStatuses.find(project_id, status_id)
status.status_id
data = %{
title: "elixir",
color: "#344563"
}
{:ok, status} = ElixirLokaliseApi.TranslationStatuses.create(project_id, data)
status.title
data = %{
title: "elixir-upd"
}
{:ok, status} = ElixirLokaliseApi.TranslationStatuses.update(project_id, status_id, data)
status.title
{:ok, resp} = ElixirLokaliseApi.TranslationStatuses.delete(project_id, status_id)
resp.custom_translation_status_deleted
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