Integrations

Bitbucket (Strings)

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.yml configuration 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_translations parameter.

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.

Connect Repositories

Once the configuration file is in place, to connect a repository, follow these steps:

  1. In the main navigation, click Automations, then Repo Syncs.

    Alternatively, from the Integrations page, scroll down to Repo Sync and click Configure.

    The Repo Syncs page opens. The Repo Syncs list displays only projects the viewing user has access to.

  2. Click Add Sync/Bitbucket.

    The Bitbucket Sync activation page opens.

  3. Select the Bitbucket account to be connected from the Authorize for workspace dropdown list and click on Grant access.

    The connection between Phrase Strings and the selected Bitbucket account is established. The Bitbucket sync settings window is displayed.

    Note

    It is not possible to connect multiple accounts via the Bitbucket integration.

  4. Select a project from the dropdown list.

  5. Select a Bitbucket repository from the dropdown list.

    If repository ownership is not correct, the repository will not be visible in the dropdown list.

  6. Select a Repository branch from the dropdown list to import (push) and export (pull) from. This is usually the master branch.

  7. Click Validate Configuration to ensure authentication settings and configuration file are correct.

  8. Optionally select Auto import to import files with every commit to the selected Bitbucket branch.

  9. Optionally select the Owner of the repo sync. The owner defaults to the account owner and must be an active member of the account with access to the project.

    Automated actions, such as automatic exports and imports, run on behalf of the owner. Manual imports and exports use the current user.

  10. Optionally select one or more Export triggers to export automatically. If Schedule is selected, set the frequency, time, days of the week or day of the month, and time zone.

  11. Click Save.

    The project is now connected to the selected Bitbucket repository and added to the list.

  12. (Optional) Click the pencil icon to rename the integration.

Integrations can be deactivated or removed from the Repo Syncs page.

Optionally, users can remove a Bitbucket integration by revoking the authorization for Phrase Strings in their Bitbucket personal settings.

Import from Bitbucket

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:

  1. From the Repo Syncs page, select a project and click Import Sync Import.

    Translations are pulled into the project. Keys and current translations are updated.

  2. Approve, merge or close the pull request in Bitbucket.

Export to Bitbucket

To export locale files to Bitbucket, follow these steps:

  1. From the Repo Syncs page, select a project and click Export Sync Export.

    The Export window is displayed.

  2. Provide the target branch in the PR branch field.

    The most recent files in the repository will be exported as a new pull request to the desired branch.

  3. Once files are exported, the pull request can be merged or closed in the repository and the branch can be deleted.

    Each exported language results in a separate commit within the pull request. Consolidating all exported languages into a single commit is not currently supported for Bitbucket, unlike the GitHub integration.

Automatic Exports

A repo sync can export automatically. Select one or more of the following triggers:

  • On a schedule: the export runs on a recurring schedule.

  • When a branch is merged: the export runs when a branch of the project is merged.

  • When a job is completed: the export runs when a job in the project is completed.

Triggers can be combined, changed, or removed at any time. Automatic exports run only while the repo sync is active.

If several merges or job completions occur within a short time, only one export runs.

Note

When zero-touch localization is enabled for the project, the Branch merged trigger does not fire.

History

Repo syncs keep a history of the latest imports and exports for each Phrase Strings project.

To view the history:

  • From the Repo Syncs page, select a project and click History Sync History.

    The import and export history for the project is presented. Export entries in the history include a link to the corresponding merge request.

Was this article helpful?
★ ★ ★ ★ ★

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.