---
title: "build"
description: "Write one JSON bundle per locale from the records your sources use."
canonical_url: "https://diglot.sh/workflow/cli/build"
---
# build

> Write one JSON bundle per locale from the records your sources use.

`diglot build` collects the records of each locale into `dist/<locale>.json`, the file your site reads when it applies translations. Every bundle has the form `{ version, locale, records }`, with records keyed by hash.

```bash
pnpm dlx @diglot/cli build [--locale fr] [--all]
```

## Options

<table>
<thead>
  <tr>
    <th>
      Option
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --locale
      </code>
    </td>
    
    <td>
      all locales
    </td>
    
    <td>
      Build only this locale
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --all
      </code>
    </td>
    
    <td>
      off
    </td>
    
    <td>
      Include records that no source uses
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --cwd
      </code>
    </td>
    
    <td>
      <code>
        .
      </code>
    </td>
    
    <td>
      The translations repository root
    </td>
  </tr>
</tbody>
</table>

By default a bundle contains only the records whose hash appears in a manifest. If there are no manifests at all, every record is included. The output directory is `dist` unless you set `outDir` in the [configuration](https://diglot.sh/guide/how-to/configure).

## Output

For each locale, the command prints the number of records, how many of them a reviewer rejected, the path, and how many unused records it skipped:

```text
fr: 1204 records (3 rejected) -> dist/fr.json (88 unused skipped)
```

The numbers are examples of the format. Rejected records are part of the bundle on purpose, so a site can show their status. Applying the bundle still falls back to the source text for them, as [review and status](https://diglot.sh/guide/concepts/review-and-status) explains.


## Sitemap

See the full [sitemap](https://diglot.sh/sitemap.md) for all pages.
