---
source: https://studio.eloqnt.dev/docs/formats/i18next-json
docs_index: https://studio.eloqnt.dev/llms.txt
---

# i18next JSON

Translate i18next JSON translation files (v4), including plural-suffix keys and interpolation.

i18next stores its translations as JSON files, one folder per locale, in the [i18next JSON v4 format](https://www.i18next.com/misc/json-format) (the default since i18next v21).

Install the format package:

```bash
npm install -D @eloqnt/format-i18next-json
```

Then reference it from your configuration:

```ts title=".eloqnt/config.ts"
import {defineConfig} from '@eloqnt/cli';

export default defineConfig({
  messages: {
    path: './locales/{locale}/{namespace}',
    locales: 'infer',
    sourceLocale: 'en',
    format: {
      codec: '@eloqnt/format-i18next-json',
      extension: '.json'
    }
  }
});
```

This matches files like:

- `locales/en/common.json`
- `locales/en/settings.json`
- etc.

## Plurals

i18next spells plurals as key suffixes, one key per plural form:

```json title="locales/en/translation.json"
{
  "cart_one": "{{count}} item",
  "cart_other": "{{count}} items"
}
```

eloqnt/cli parses this as ICU for operations like [`eloqnt lint`](https://studio.eloqnt.dev/docs/cli/lint) and [`eloqnt translate`](https://studio.eloqnt.dev/docs/cli/translate):

```text
{count, plural, one {{count} item} other {{count} items}}
```

This is only an intermediate representation that serializes back to i18next JSON.

**Note:** The `_other` form is required for a group of keys to be recognized as a plural.

## Not supported

The following features are not supported:

- **i18next JSON v3 and older**: Please migrate to v4.
- **Array values**: Their items are positional and unnamed, which is why most localization tools can't translate them reliably. Give each item its own key instead.
- [`srcPath`](https://studio.eloqnt.dev/docs/configuration#srcPath): Source code analysis is currently limited to `next-intl`.

---

For an index of every eloqnt/studio documentation page, see [https://studio.eloqnt.dev/llms.txt](https://studio.eloqnt.dev/llms.txt).
