---
title: "i18n-tag"
description: "The preset for es2015-i18n-tag. It reads i18n tagged templates in JS, TS and Vue files."
canonical_url: "https://x18n.dev/presets/i18n-tag"
---
# i18n-tag

> The preset for es2015-i18n-tag. It reads i18n tagged templates in JS, TS and Vue files.

The `i18n-tag` preset supports [es2015-i18n-tag](https://github.com/skolmer/es2015-i18n-tag).

## Detection

The preset applies when the project depends on `es2015-i18n-tag`.

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

export default defineConfig({
  presets: ['i18n-tag'],
})
```

## Locale files

The preset adds no resource patterns. Set `resources` in the config, or let x18n guess the locale directories. For example, x18n finds `locales/en.json` without a config.

## Supported syntax

In JS, TS and Vue files, the preset reads the `i18n` tagged template. The text of the template is the key:

```js [src/a.js]
const x = i18n`Hello`
```

This is a usage of the key `Hello`.

## Placeholders

The preset adds no placeholder syntax.

## Extraction templates

| Kinds                      | Template        |
| -------------------------- | --------------- |
| `js-string`, `js-template` | ``i18n`{key}``` |


## Sitemap

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