In order to identify which locale files you want to sync with PhraseApp, we rely on the
.phraseapp.yml configuration file being present in your GitHub repository.
The file is used by most PhraseApp clients and defines which files you want to import (push) and export (pull).
See the documentation to learn more about how to set up your PhraseApp configuration file.
Connect your project
If you have set up and uploaded your configuration file to GitHub, it’s time to connect your repository to PhraseApp:
- Go to the Project Settings of the project you want to connect and select GitHub Sync.
- Enable GitHub Sync and enter a valid GitHub personal access token. You can create an access token in your GitHub Settings. Make sure the access token has the
repoif scope (or
public_repoif you want to sync with a public GitHub repository).
- Select the GitHub repository you want to sync with PhraseApp.
- Select the repository’s branch used to import (push) and export (pull) your locales (usually ‘master’)
- Click Validate Configuration to check if your access token and the configuration file is set up correctly.
- Click Save.
Your project is now connected to your GitHub repository!
Importing your locale files to PhraseApp from your connected GitHub repository is easy:
- Go to the Locales section.
- If you haven’t created any locales yet, add at least your default locale.
- Click GitHub Sync > Import from GitHub
- Your locale files (defined as push source entries in your configuration file) are now imported into your PhraseApp project. This can take a few seconds and you will see the status as new updates in your project’s activity stream.
You can also import your locales to PhraseApp after every commit to GitHub with Auto-Import:
- Go to your project’s settings in PhraseApp and select GitHub Sync.
- Enable the auto import option.
- Generate a payload URL and copy it. Please note that this will automatically generate a PhraseApp access_token that can be managed in your Profile Settings
- Click Save.
Next, add a webhook to your GitHub repository in order to notify PhraseApp of new pushes:
1. Go to your GitHub repository’s Settings section and select Webhooks & services
2. Add a new webhook:
- Payload-URL: Paste your generated payload URL.
- Secret: leave blank
- Let the webhook trigger just the push event
3. Click Add webhook
You have successfully activated Auto-Import for your PhraseApp project and we will import locale files from your repository after every update pushed to the selected branch (usually ‘master’) of your repository.
Exporting the most recent locale files to your repository is just one click away:
- Go to the Locales section.
- Click GitHub Sync > Export to GitHub as pull request
- After a few seconds, your most recent locale files are exported to your GitHub repository as a new pull request. You will see this as an update in your project’s activity stream, too.
You can now head over to your Github repository in order to merge (or close) the pull request. Don’t forget to delete the branch after that.
Why a pull request?
We’re delivering locale file updates as pull requests so that you can review all changes and thus remain in charge of what actually goes into your selected branch (usually ‘master’).
Github Sync also supports Github Enterprise. To sync with a self-hosted Github Enterprise instance you need to enable Github Enterprise in the project settings and add the API URL to an Enterprise instance. Please make sure that the API endpoint is publicly reachable from PhraseApp.
The validation fails although the configuration file seems correct, what's wrong?
Make sure you have set up at least one push source and one pull target entry in your configuration file. Double check if you have entered a valid Project ID and that the Project ID belongs to the PhraseApp project you want to sync your files with.
Why does nothing gets imported?
Please make sure that your
.phraseapp.yml configuration file contains valid push sources. Note that a lot of file formats require the
locale_id to be defined for each source since they don’t contain any information on the locale in the file itself.
You can always use the PhraseApp Client in order to check if your configuration file behaves as you expect.
Why does auto-Import not work?
Go to your GitHub repository’s Settings section of the project you have enabled auto-import for and select Webhooks & services. Click on the webhook you’ve added in order to notify PhraseApp about changes. Make sure you have entered the correct Payload URL and it contains the valid Project ID and access token.
You can also examine the most recent deliveries for each webhook and check out the response for error messages returned by PhraseApp.
It still doesn’t work
Contact us — we’re happy to help.