Elixir interface for the Lokalise APIv2.
View the Project on GitHub lokalise/elixir-lokalise-api
This endpoint also supports cursor pagination which is now a recommended approach, especially for fetching large amounts of data. Please learn more in the Pagination docs.
{:ok, keys} = ElixirLokaliseApi.Keys.all(project_id, page: 2, limit: 3)
key = hd keys.items
key.key_id
{:ok, key} = ElixirLokaliseApi.Keys.find(project_id, key_id, disable_references: "1")
key.key_id
data = %{
keys: [
%{
key_name: %{
web: "elixir",
android: "elixir",
ios: "elixir_ios",
other: "el_other"
},
description: "Via API",
platforms: ["web", "android"],
translations: [
%{
language_iso: "en",
translation: "Hi from Elixir"
},
%{
language_iso: "fr",
translation: "test"
}
]
}
]
}
{:ok, keys} = ElixirLokaliseApi.Keys.create(project_id, data)
key = hd keys.items
key.key_name.android
data = %{
description: "Updated via SDK",
tags: ["sample"]
}
{:ok, key} = ElixirLokaliseApi.Keys.update(project_id, key_id, data)
key.key_id
data = %{
keys: [
%{
key_id: key_id,
description: "Bulk updated via SDK",
tags: ["sample"]
},
%{
key_id: key_id2,
platforms: ["web", "android"]
}
]
}
{:ok, keys} = ElixirLokaliseApi.Keys.update_bulk(project_id, data)
keys.items
{:ok, resp} = ElixirLokaliseApi.Keys.delete(project_id, key_id)
resp.key_removed
data = %{
keys: [
key_id,
key_id2
]
}
{:ok, resp} = ElixirLokaliseApi.Keys.delete_bulk(project_id, data)
resp.keys_removed