- Pull Request Mode - monitors pull requests and draft pull requests, and uploads resource files if changes have been made
- Single Branch Mode - monitors commits and uploads resource files if changes have been made
- On-Demand Mode - content is sent for translation and delivered back manually
Note: Content branch names must not begin with "Smartling" as the Connector interprets branches starting with "smartling-" as self-created ones with translations and will not monitor changes in them.
Pull Request Mode
Pull Request Mode watches a selected branch in your repository for all pull requests and draft pull requests containing translatable files. You can customize the configuration set not to watch draft PRs.
Once translatable files are found, the GitHub Connector creates a "Smartling Translation" status check on that pull request, and automatically sends those files to Smartling for translation. Pull Requests with the "Smartling Translation" status should not be merged or deleted until the translations have been successfully delivered.
Status Checks
- If the connector created a translation job and waiting for its completion, the status is
Pending - Pull request is being translated
- If the connector is delivering translation/changes to a new translation PR, the status is
Pending - Translated files are being delivered to the branch
- If the connector has delivered changes and is waiting for translation PR merge, the status is
Pending - Translated files have been delivered. Waiting for translation pull request merge
The status check can be configured in GitHub so that the pull request remains locked until translations are done (Under "Branch protection rule" > "Require status checks to pass before merging").
Alternatively, you can enable Translation Hold on the configuration set to pull request mode. This setting automatically applies a "hold" label to your GitHub pull requests. This instructs the connector to put a hold on the creation of Smartling translation jobs until the label is manually removed in GitHub. When a pull request is ready to be translated, removing the label manually in GitHub will trigger the creation of translation jobs.
Translation Delivery
Once the translation job is completed for all configured languages, the connector creates a separate Smartling Translation branch from the original branch that triggered the translation Job from the Pull Request.
This new branch contains the translated files, and follows the naming convention:
smartling-translation-[status]-[Job UID]-from-[original branch name that triggered
the PR]
e.g.: smartling-translation-completed-94wpkn6cgztj-from-create-original-string
Note: Ensure there are no custom security rules on your GitHub that prevent the creation of translation branches, as this will block translation delivery.
The connector then raises a Pull Request against the source branch, which then needs to be merged into the source branch. You can customize the configuration set to add all developers who worked on the pull request (committers) as reviewers in GitHub to the translation pull request.
Once this Pull Request is accepted and merged into the source branch, the "Smartling Translation" check is marked as resolved, unlocking the original Pull Request. Both the source files and their corresponding translations can then be merged into the watched branch.
Tip: Watch our video explanation of Pull Request Mode here.
Single Branch Mode
With the Single Branch Mode, the Connector monitors the watched branch for commits. As soon as a commit is made, Smartling creates a translation Job for the file. Upon completion of the translation Job for all languages, the translations are delivered to GitHub in a separate Smartling Translation Branch that is created from the initial commit.
To deliver the translated files, the Connector raises a Pull Request to the watched branch labeled "Smartling translations are completed" or "Smartling translations are updated". If no conflicts are present, the Pull Request can be merged and the Smartling Translation Branch can be deleted.
Tip: Watch our video explanation of Single Branch Mode here.