Translation statuses endpoint¶
Translation statuses documentation
Fetch all translation statuses¶
- translation_statuses(project_id[, params = None])¶
- Parameters:
project_id (str) – ID of the project
params (dict) – (optional) pagination options
- Returns:
Collection of translation statuses
Example:
statuses = client.translation_statuses('123.abc', {
"page": 2,
"limit": 1
})
assert statuses.items[0].title == "waiting for approval"
Fetch a translation status¶
- translation_status(project_id, translation_status_id)¶
- Parameters:
project_id (str) – ID of the project
translation_status_id (int or str) – ID of the status to fetch
- Returns:
Translation status model
Example:
status = client.translation_status('123.abc', 345)
status.title # => "needs context"
status.color # => "#61bd4f"
Create translation status¶
- create_translation_status(project_id, params)¶
- Parameters:
project_id (str) – ID of the project
params (dict) – Translation status parameters
- Returns:
Translation status model
Example:
status = client.create_translation_status('123.abc', {
"title": "Python status",
"color": "#ff9f1a"
})
status.title # => "Python status"
status.color # => "#ff9f1a"
Update translation status¶
- update_translation_status(project_id, translation_status_id[, params = None])¶
- Parameters:
project_id (str) – ID of the project
translation_status_id (int or str) – ID of the status to update
params (dict) – Translation status parameters
- Returns:
Translation status model
Example:
status = client.update_translation_status('123.abc', 3456, {
"title": "Python status updated"
})
status.title # => "Python status updated"
Delete translation status¶
- delete_translation_status(project_id, translation_status_id)¶
- Parameters:
project_id (str) – ID of the project
translation_status_id (int or str) – ID of the status to delete
- Returns:
Dict with project ID and custom_translation_status_deleted: True
Example:
client.delete_translation_status('123.abc', 345)
Fetch all available statuses colors¶
- translation_statuses_colors(project_id)¶
Fetches available RGB colors that can be assigned to translation statuses.
- Parameters:
project_id (str) – ID of the project
- Returns:
List with the RGB color codes
Example:
colors = client.translation_statuses_colors('123.abc')
colors[0] # => '#61bd4f'