---
name: Tooling
menu: '@jetshop/intl'
route: /intl/tooling
---

# Tooling

The `@jetshop/intl` package also exposes some tooling to make translating your shop easier.

## Extracting translations

Before starting to translate the shop, you need to extract the translation strings from the source code. `@jetshop/intl` provides the command `extract` that searches through your codebase and extracts all translation strings and puts them in `translations/default.json` in your shop.
By default this script is added to `package.json` in your shop, so you can run this in a terminal:

```bash
yarn intl extract
```

Once the translation strings are extracted they get a unique ID, which is used to know where the translation string should be used. Based on the `default.json` file you can then create a file for every locale you want to support, e.g. `sv.json` (Swedish) and `en.json` (English).
Usually the translation strings in the source code are written in English, so `en.json` should just be a copy of `default.json`.

If you add a new locale, make sure to also update the `translations/index.js` file which is an entry point for all translations.

When the app is rendered (on server and client) Flight will use the translation provided in your localized json file, and fall back to the default translation if it's not found.

## Linting translations

In order to make sure your translations are complete, there's also a linting command. This checks all translation files in your `translations/` folder to make sure there's no missing translations anywhere. Run this command in your terminal:

```bash
yarn intl lint
```
