---
title: "i18next-shopify"
description: "The preset for the Shopify format of i18next. It reads nested plural keys and {name} placeholders, plus everything of react-i18next."
canonical_url: "https://x18n.dev/presets/i18next-shopify"
---
# i18next-shopify

> The preset for the Shopify format of i18next. It reads nested plural keys and \{name} placeholders, plus everything of react-i18next.

The `i18next-shopify` preset supports [i18next-shopify](https://github.com/Shopify/i18next-shopify), the i18next plugin for the Shopify message format.

## Detection

The preset applies when the project depends on `@shopify/i18next-shopify`.

```ts [x18n.config.ts]
import { defineConfig } from '@x18n/core'

export default defineConfig({
  presets: ['i18next-shopify'],
})
```

## What it adds

The preset includes everything of the [`react-i18next`](https://x18n.dev/presets/react-i18next) preset. If the `react-i18next` preset also applies, x18n adds the shared plugins one time.

The Shopify format keeps plural and ordinal forms as nested keys. The preset adds the derived keys `{key}.ordinal.{ordinal}`, `{key}.{plural}`, `{key}.plural`, and `{key}.0` to `{key}.9`. Each locale needs the plural categories of its own language: Japanese needs only `{key}.other`, and Polish needs `{key}.one`, `{key}.few`, `{key}.many` and `{key}.other`. New files use nested keys.

## Locale files

The preset adds no resource patterns. Set `resources` in the config, or let x18n guess the locale directories:

```ts [x18n.config.ts]
import { defineConfig } from '@x18n/core'

export default defineConfig({
  resources: [
    { pattern: 'locales/{locale}.json' }
  ],
})
```

## Supported syntax

The calls of [react-i18next](https://x18n.dev/presets/react-i18next#supported-syntax). For this file, `t('cart.items', { count })` uses `cart.items.one` and `cart.items.other`, so the [`unused-key`](https://x18n.dev/checks/unused-key) check reports neither:

```json [locales/en.json]
{
  "cart": {
    "items": {
      "one": "{count} item",
      "other": "{count} items"
    }
  }
}
```

## Placeholders

Braces: `{name}`. The placeholders of i18next stay: `{{name}}` and `$t(key)`.

## Extraction templates

The templates of [react-i18next](https://x18n.dev/presets/react-i18next#extraction-templates).


## Sitemap

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