|
Documentation
Book a DemoPlatform
PlatformMCPCLIAPIWorkflows
GuidesChangelog

Continuous Localization

  • How it works
  • Setup

Platforms

  • GitHub App
  • GitHub
  • GitLab CI/CD
  • Bitbucket Pipelines
  • Advanced patterns

Bitbucket Pipelines

On Bitbucket, run the @lingo.dev/cli inside a pipeline step: install it, run lingo push to translate changed source strings through your engine, then commit the results or open a pull request with Bitbucket's own tooling.

Prerequisites

You need a committed .lingo/config.json (with an engineId, source and target locales, and files patterns) and your Lingo.dev API key stored as a repository variable. See the CLI quickstart to create the config.

Authentication#

The CLI authenticates with the LINGO_API_KEY environment variable. Add your key as a secured repository variable so it is available to pipeline steps:

Repository settings > Repository variables — add LINGO_API_KEY and mark it secured.

To push commits or open pull requests back to the repository, the pipeline also needs Git write access. The standard options are a repository SSH key (Repository settings > SSH keys) or a repository access token with Read & write repositories (and pull requests, for PR mode) scope, stored as a secured repository variable such as BB_TOKEN.

Workflow examples#

Direct commit (default)#

Install the CLI, run lingo push, and commit the translated files back to the branch:

yaml
image: node:22

pipelines:
  branches:
    main:
      - step:
          name: Translate
          script:
            - npm install -g @lingo.dev/cli
            - lingo push
            - git config user.name "lingo-bot"
            - git config user.email "support@lingo.dev"
            - git add .
            - git diff --cached --quiet || git commit -m "chore: update translations"
            - git push origin HEAD:main

lingo push translates only what changed since the last run (tracked in .lingo/lock.json), waits for the run to finish, and writes the outputs to disk.

Pull request mode#

Push the translations to a dedicated branch instead of committing to main, then open a pull request with Bitbucket's tooling:

yaml
image: node:22

pipelines:
  branches:
    main:
      - step:
          name: Translate
          script:
            - npm install -g @lingo.dev/cli
            - lingo push
            - git config user.name "lingo-bot"
            - git config user.email "support@lingo.dev"
            - git checkout -b lingo/translations
            - git add .
            - git diff --cached --quiet || git commit -m "feat: update translations"
            - git push origin lingo/translations
            # Open a PR from lingo/translations into main via the Bitbucket UI or API

Monorepo#

Run the CLI from a subdirectory when your config lives inside a workspace. The CLI resolves .lingo/config.json from the working directory:

yaml
image: node:22

pipelines:
  branches:
    main:
      - step:
          name: Translate
          script:
            - cd apps/web
            - npm install -g @lingo.dev/cli
            - lingo push

Pipeline variables#

VariableRequiredDescription
LINGO_API_KEYYesLingo.dev API key. Store as a secured repository variable.
BB_TOKENFor push/PR write accessRepository access token (or SSH key) used by Git to commit or open pull requests.

Everything else — source locale, target locales, file patterns, and the engine to route through — lives in .lingo/config.json, not in pipeline variables.

Verify before deploy#

Add a lingo check step to fail the pipeline when any source string is missing a translation:

yaml
- step:
          name: Check translations
          script:
            - npm install -g @lingo.dev/cli
            - lingo check

Next Steps#

GitHub App
Hands-off continuous localization on GitHub
GitHub Actions
Run the CLI in a GitHub Actions job
GitLab CI/CD
Run the CLI in a GitLab pipeline
Advanced Patterns
Translation checks, merge conflicts, workflow selection

Was this page helpful?

Max PrilutskiyMax Prilutskiy·Updated 27 days ago·2 min read