Link Transifex with GitHub
Simply point, click and update resources directly from Github with no coding. With the new GitHub Integration you will be able to connect a localization project in Transifex with a specific repository in GitHub using only the Transifex user interface.
To begin you require two basic steps:
Choose to link to GitHub
- Visit your Transifex Organization settings
- From the Left Hand Side Menu that appears, select Manage Integrations
- Click on the Install the Transifex App link.
- Select the GitHub Organization you wish to install the Transifex App to.
Connect the GitHub account with your localization organization in Transifex.
- Return back to the Manage Integrations Page in Transifex and click on the Authorize Transifex Link.
- Authenticate to GitHub and choose one or more repositories to make visible in Transifex. Authentication and repository selection on Github should be done by an owner (admin) of the account.
- When you are done with this process, you have authorized the selected GitHub repositories to be able to link to your organization’s localization projects.
Navigate to the project of your choice or create a new project and visit the Project settings page. In there, you will see a tab reading “Integrations”.
If the integration is set up as described in the previous step, you will see the GitHub option along with a button to Link Repository. Clicking on that button, the GitHub Integration wizard will pop up to manage the setup.
On the first step of the wizard, select the GitHub repository and branch to sync with the project.
Available repositories listed are the ones you authorized when you installed the Transifex app on the Github account you used for the integration. Also, at this point the GitHub integration works on top of a single branch.
When you are done with this step, hit Next to setup the repository files that are related to localization. In this step, you define which files you want to localize along with some extra information that are required for the integration to work. The extra information required is:
- filter_type: This specifies a directory or file
- source_file: This points to the location of the source file. In case a directory is being used, then the field "source_file_dir" must be used instead.
- file_format: This sets the type of the resources in your project, e.g. to PO. See the File formats section for details about the i18n type of each format available.
- source_file_extension: This field is required in case a directory is being used
- source_language: This is the source language of your project, such as
enfor English. This is the language you selected when you created your project.
- translation_files_expression: A path expression which reflects the file/directory structure of your translation files. The expression must contain the <lang> keyword, denoting where the file paths differentiate per language, e.g.
The configuration follows a YAML syntax, and users can define a list of individual files or use regular expressions to match multiple files at once. Illustrated examples can be found below:
- filter_type: file
- filter_type: dir
Clicking the Next button navigates to the final step of the setup, where you will define how the syncing between Transifex and GitHub will happen.
Pulling content from the designated GitHub repository and branch happens automatically upon changes on that branch.
To push localized content from Transifex back to GitHub you have the following options:
Upon 100% translated, reviewed or proofread content.
Push content via a Pull Request on that branch, which will create a new branch with the localized content and open a Pull Request on the branch, that you can later merge directly from GitHub.
Push content via a commit back to the selected branch.
When you are done with this setup you can click Save & Sync to start syncing content from GitHub to Transifex.
Syncing content from GitHub to Transifex happens either upon saving or updating the integration settings on the project level or automatically whenever new content is found on GitHub (after a commit on the branch that is associated with the integration).
When a syncing process is initiated, you will be able to see that syncing is in process in your Project settings > integrations tab under GitHub. This process could take some time, depending on the number and size of the files that are syncing.
On Project settings > integrations tab you will also be able to see details about the latest syncing with GitHub, so that you can detect any possible issues with specific files that either failed to be synced or weren’t found so that you can take some action to fix them.
As your project evolves, you might end up in situations that you want to either extend the files you are syncing from GitHub or change the workflow of pushing localized content back on GitHub. To edit your options visit your Projects settings > integrations tab and click on the button in the GitHub integration.
The interface to make the changes is the same as the one of the initial setup, but you will only be able to:
Update the detected files in the GitHub repository, by changing the YAML configuration.
Change options on how updates from Transifex are sent back to GitHub.
Please note that if you remove an already synced file or directory from the YAML configuration, the associated resource will also be deleted from Transifex, along with all its translations.
Any commits or PRs that are opening due to the integration are happening from a GitHub user called Transifex-localization-platform[bot].