Menu
Generate Translations
Set Up Translations
POST
/utils/translations/generateUse it in a workflow
- Add a step and choose the Directus connector.
- Pick the Generate Translations action (under Utilities).
- Fill in the fields below, then reference the result from later steps as
{{generateTranslations.response.data}}.
Request
Request body
Enter the body as JSON in the step's Body field.
{
"collection": "articles",
"fields": [
"title",
"body"
],
"translationsCollection": "articles_translations",
"languagesCollection": "languages",
"parentFkField": "articles_id",
"languageFkField": "languages_code",
"createLanguagesCollection": true,
"seedLanguages": true
}
Response
Returns 200 with an object. Read it in later steps with {{generateTranslations.response.data.<field>}}.
{
"data": {
"created": false,
"translationsCollection": "string",
"languagesCollection": "string",
"fields": [
"string"
]
}
}
Need more? See the Directus guide for connection setup and behaviour shared by every action.
Was this page helpful?