# General Translation Platform: Configuring Locadex automations URL: https://generaltranslation.com/en-US/docs/platform/locadex/guides/configuring-automations.mdx --- title: Configuring Locadex automations description: "How to configure Locadex automations: this guide covers templates, triggers, branches, pull request behavior, and commands." related: links: - /docs/platform/locadex/guides/auto-merging-prs - /docs/platform/locadex/guides/managing-languages - /docs/platform/locadex/guides/viewing-automation-activity - /docs/platform/locadex/guides/adding-environment-variables --- Use automation settings to control what Locadex changes, when it runs, and how it creates or updates pull requests. Locadex has three templates. Each automation can run when a pull request changes, when a commit is pushed, or manually. ## Choose a template [#choose-template] Open **Project > Automations**. Under **Start with a template**, choose: - **Generate code** for code internationalization. - Set when Locadex should wrap your source code with internationalization library calls such as `t()` or the `T` component. - **Generate translations and push** for content updates. - Set when Locadex should translate new or updated source content into target languages. - **Keep locales in sync** for locale updates. - Set when Locadex should update files in your Project if languages are added or removed. A manual run lets you choose the source and target locales. Choose a configured automation from this page to edit it. You can also use **Organization > Locadex > Automations** to search and manage automations across Projects. ## Configure an automation [#configure-automation] ### Edit the trigger Set **Run when** to one of three triggers: - **A pull request changes** runs when a relevant pull request is opened, reopened, or marked ready for review. New commits cancel any in-progress run but do not start another; comment `/locadex` when the pull request is ready to process again. - **A commit is pushed** runs when commits are pushed to the target branch. - **Started manually** runs only when you click **Run now**. New **Generate code** and **Generate translations and push** automations default to **A pull request changes**. **Keep locales in sync** defaults to **Started manually**. ### Edit target branch and prefix Set **Target branch** to the branch Locadex should monitor for changes. Most Projects use `main`. Set **Created branch prefix** for branches created by Locadex. The default is: ```txt locadex/ ``` Use a stable prefix so Locadex branches are easy to find in GitHub. ### Edit PR settings Use the toggles to control how Locadex creates and manages pull requests: - **Auto-merge** merges Locadex pull requests automatically when checks pass. See [Auto-merging Locadex PRs](/docs/platform/locadex/guides/auto-merging-prs). - **Changed files only** limits the **Generate code** relevance check to changed lines instead of the full contents of modified files. Translation and locale synchronization automations do not use this filter, and documentation frameworks skip the relevance check. - **Preserve local edits** keeps manual edits to files Locadex generated earlier. For automatic triggers, Locadex reuses the open pull request for the same source branch and automation. Before an incremental update, it marks the reusable PR as draft and posts a per-run status comment. It returns the PR to ready for review only if it was ready before the run; a user-held draft remains draft. Manual Dashboard runs use one-off pull requests. For an automation triggered by a pull request, Locadex comments on the triggering PR with a link to the separate Locadex PR when it creates one. The text boxes at the bottom of the page provide additional customizability: - **Pull request title** sets the title used for Locadex pull requests. - **Pull request description** sets the pull request body. - **Commit message** sets the message used for Locadex commits. ### Add commands Use commands to run steps such as setup or validation on your Project. Use commands to install dependencies, build your Project, lint generated changes, or run Project-specific checks. Commands can be run before or after Locadex processes files: - **Pre-process command** runs before Locadex processes files. For example, run `npm run build`. - **Post-process command** runs after Locadex processes files. For example, run `npm run typecheck`. Commands run from the repository root and inside the [Locadex VM image](/docs/platform/locadex/reference/vm-image). If an automation fails because a package, script, or binary is missing, add a pre-process command. If any checks fail, [auto-merge](/docs/platform/locadex/guides/auto-merging-prs) will not run. ## Next steps - /docs/platform/locadex/guides/auto-merging-prs - /docs/platform/locadex/guides/managing-languages - /docs/platform/locadex/guides/viewing-automation-activity - /docs/platform/locadex/guides/adding-environment-variables