Tip
For information about Bitbucket integration in Phrase TMS, refer to Bitbucket Cloud (TMS).
-
Bitbucket Sync is only supported for Bitbucket Cloud. It cannot be used with Bitbucket Server.
-
Bitbucket Sync can be used via API.
Prerequisites
-
The
.phrase.ymlconfiguration file must be present in the root of the branch to be monitored. The file defines which files to import (pull) or export (push) from the repository. -
Read and write access are required for the repository.
-
Incorrectly defined configuration files may cause errors. Ensure that the file contains at least one push and one pull target, correct file formats and the correct setting of the
update_translationsparameter.
Sample configuration file:
phrase:
project_id: 1f61b9ecdb7a17a9dd174302419c50cc
file_format: simple_json
push:
sources:
- file: ./<locale_name>.json
pull:
targets:
- file: ./<locale_name>.json
Project ID of a project is found in project settings.
Once the configuration file is in place, to connect a repository, follow these steps:
-
From the page, scroll down to and click Configure.
The page opens.
-
Click Add Sync/Bitbucket.
The Bitbucket Sync activation page opens.
-
Select the Bitbucket account to be connected from the dropdown list and click on Grant access.
The connection between Phrase Strings and the selected Bitbucket account is established. The settings window is displayed.
Note
It is not possible to connect multiple accounts via the Bitbucket integration.
-
Select a project from the dropdown list.
-
Select a from the dropdown list.
If repository ownership is not correct, the repository will not be visible in the dropdown list.
-
Select a from the dropdown list to import (push) and export (pull) from. This is usually the master branch.
-
Click Validate Configuration to ensure authentication settings and configuration file are correct.
-
Optionally select to import files with every commit to the selected Bitbucket branch.
-
Click Save.
The project is now connected to the selected Bitbucket repository and added to the list.
Integrations can be deactivated or removed from the page.
Optionally, users can remove a Bitbucket integration by revoking the authorization for Phrase Strings in their Bitbucket personal settings.
After activating Bitbucket Sync and connecting a repository, locale files can be imported. This is done in the form of pull requests, so changes can be reviewed, and branch management can be controlled.
To import locale files from Bitbucket, follow these steps:
To export locale files to Bitbucket, follow these steps:
-
From the page, select a project and click Export
.
The window is displayed.
-
Provide the target branch in the field.
The most recent files in the repository will be exported as a new pull request to the desired branch.
-
Once files are exported, the pull request can be merged or closed in the repository and the branch can be deleted.
Repo syncs keep a history of the latest imports and exports for each Phrase Strings project.
To view the history: