Use this integration to synchronize translation files between your GitHub repository and Localizely project.
Once you configure the integration, you can pull the files from GitHub by using the Localizely web console. Pull can be automated via webhooks so it is triggered whenever new code changes are pushed to GitHub by your development team.
When the translations are done, you can push the translations to GitHub by creating a pull request.
localizely.yml
fileGitHub integration relies on the localizely.yml
configuration file in your GitHub repository, so Localizely knows what files to synchronize. This file defines which files you want to import (pull) from and export (push) to GitHub.
Here is a minimal configuration file for Flutter projects:
config_version: 1.0 # Only 1.0 available
project_id: c776c33e-f428-4c91-87e1-a6a18c1554fe # Your project ID from: https://app.localizely.com/projects
file_type: flutter_arb
upload:
files: # List of files for upload to Localizely. Usually it is just one file used for the main locale
- file: lib/l10n/intl_en.arb
locale_code: en
download:
files: # List of files for download from Localizely.
- file: lib/l10n/intl_en.arb
locale_code: en
- file: lib/l10n/intl_de.arb
locale_code: de
- file: lib/l10n/intl_es.arb
locale_code: es
See the documentation to learn more about how to set up your Localizely configuration file.
You will need to generate and copy/paste a personal access token from GitHub. Navigate to github.com, click on your avatar in the top right corner, and choose Settings > Developer settings > Personal access tokens. Next, click Generate new token to generate a new (classic) access token. Make sure the token has the repo
scope.
In addition to the regular (classic) token, you can also use a fine-grained personal access token. If you opt for this type of token, ensure your repository is in the Repository access section, and the token's Repository permissions allow "Read and write" access for Contents and Pull requests.
Once you have generated the access token, make sure to copy it.
Go to the settings for the Localizely project and select GitHub Integration under the Integrations section.
Your access token is safe, it is stored in an encrypted form in our system.
Go to Project Settings > Integrations > GitHub, and click the Pull now button.
Once you make Pull works, it is practical to set up a webhook in GitHub which automates pulling the changes to Localizely as you push code changes to GitHub.
In GitHub, navigate to your repository Settings > Webhooks and copy/paste the Webhook payload URL and Webhook secret provided in the Localizely integration configuration.
When the translations are completed, go to Project Settings > Integrations > GitHub, and click the Push now button.
The Push will do the following:
localizely_2021-01-10_13-15-10
.You may then review and merge the pull request at GitHub.
One Localizely project can be directly linked to one GitHub repository via this integration. However, you can use other integrations such as CLI or REST API to link with additional repositories.
Previous: AWS S3 integration
Read next: GitLab integration
Tired of manually editing translation files?
Our platform streamlines software localization for you.