ExCrowdin (ex_crowdin v0.1.2)
Link to this section Summary
Functions
Create a file on Crowdin with unique name
Get all tronslations of a file on Crowdin for a language
Get crowin file ID by name. If it doesn't exist, create a new one.
Upload a record to Crowdin
Link to this section Functions
Link to this function
create_crowdin_file(struct)
Specs
Create a file on Crowdin with unique name
Example
{:ok, %{"data" => %{"id" => id}}} = ExCrowdin.create_crowdin_file(%Job{})
Link to this function
get_crowdin_translations(locale, field, file_id, page \\ 0)
Specs
Get all tronslations of a file on Crowdin for a language
Example
{:ok, %{"data" => %{"stringId" => string_id, "text" => text}}} = ExCrowdin.get_crowdin_translations("fr", title, 4576)
Link to this function
get_file_id(struct, field)
Specs
Get crowin file ID by name. If it doesn't exist, create a new one.
Example
{:ok, file_id} = ExCrowdin.get_file_id(%Job{}, :title)
Link to this function
upload_one(struct, field, file_id)
Specs
Upload a record to Crowdin
Example
job = Repo.one(Job, limit: 1)
{ok, file_id} = ExCrowdin.get_file_id(%Job{}, :title)
{:ok, string_id} <- ExCrowdin.upload_one(job, :title, file_id)