Node interface for the Lokalise APIv2.
View the Project on GitHub lokalise/node-lokalise-api
Custom translation statuses must be enabled for the project before using this endpoint! It can be done in the project settings.
const statuses = await lokaliseApi.translationStatuses().list({
project_id: project_id,
page: 2,
limit: 3
});
statuses.items[0].title;
const status = await lokaliseApi.translationStatuses().get(status_id, {project_id: project_id});
status.title;
const status = await lokaliseApi.translationStatuses().create(
{title: 'my status', color: '#344563'},
{project_id: project_id}
);
status.title;
const status = await lokaliseApi.translationStatuses().update(
status_id,
{title: 'my status updated', color: '#f2d600'},
{project_id: project_id}
);
status.title;
const response = await lokaliseApi.translationStatuses().delete(status_id, {project_id: project_id});
response.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.
const colors_data = await lokaliseApi.translationStatuses().available_colors(
{
project_id: project_id,
}
);
colors_data.colors;