Connecting GitHub lets Continuous Translations create a project from a repository, and open a pull request that adds everything your repository needs to send strings and fetch translations. Merged pull requests also merge their translation branch.
Only organization owners and admins can connect GitHub, browse repositories and link them.
Connect GitHub #
- Open Organization settings → Integrations.
- In the GitHub card choose Connect. You go to GitHub to install the Continuous Translations app on your account or organization, and come back.
- The card now says “Connected to account”. Choose Add account to connect another GitHub account, or Disconnect to remove a connection.
static/screenshots/org-integrations.pngIf the card says “Not set up on this server yet”, the GitHub integration has not been configured for this installation.
Disconnecting does not change linked projects. They keep their configuration but can no longer be changed from the app. You can also remove the app in GitHub.
Create a project from a repository #
- On the Projects page choose From repository. The button appears once GitHub or GitLab is connected.
- If you connected more than one account, pick the Account.
- Pick the Repository. Private repositories are marked with a lock. Repositories that already belong to another project are not listed.
- The app looks for locale files and shows what it found, for example
locales/en.jsonand the number of translation files. - Check or adjust the form:
| Field | Notes |
|---|---|
| Project name | Filled in from the repository. |
| Source file | The path of your source language file. |
| Translation files | A path with {lang} in it, for example locales/{lang}.json. {lang} is replaced by the language code. |
| Source language | Changing it scans the repository again. |
| Translate into | Languages found in the repository are ticked. Select at least one. |
- Choose Create project.
static/screenshots/repository-dialog.pngThe app then:
- creates a project key and stores it as the
CT_API_KEYsecret of the repository, - creates the branch
ct/setupwith act.ymlfile and a GitHub Actions workflow (.github/workflows/translations.yml), - opens a pull request for you.
Merge the pull request. From then on, every push runs the workflow and sends your strings to Continuous Translations.
The setup detects the layout <directory>/<language>.json, with one JSON file per language. For other layouts, fill in the paths yourself. Names with an upper-case region, such as pt-BR.json, are not detected and must be entered by hand. A repository belongs to one project.
Link a repository to an existing project #
Open Project settings → CI & CLI. Under Repository choose Link repository and follow the same steps. The card then shows the repository, the source and translation paths, the branch, and a link to the setup pull request. Unlink removes the link only: the files and the CT_API_KEY secret in GitHub stay as they are.
Pull requests and branches #
When the workflow runs for a pull request, the strings are pushed to a branch with the name of the Git branch. A Git branch other than the default branch becomes a branch in Continuous Translations, created from main. When a pull request is merged into the default branch, the branch of the same name is merged into main automatically. Pull requests from forks are ignored.
For the commands the workflow runs, see the CLI and CI and CLI.