# @vee-validate/i18n

> Localization module for VeeValidate

Latest version **4.15.1** (published 2025-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vee-validate/i18n
pnpm add @vee-validate/i18n
yarn add @vee-validate/i18n
bun add @vee-validate/i18n
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score; popular repo.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 4.15.1 |
| Published | 2025-06-07 |
| First published | 2020-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 137.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 11260 |
| Author | Abdelrahman Awad |
| Maintainers | logaretm |

## Links

- npm: https://www.npmjs.com/package/@vee-validate/i18n
- Repository: https://github.com/logaretm/vee-validate
- Homepage: https://vee-validate.logaretm.com/v4/guide/i18n
- Issues: https://github.com/logaretm/vee-validate/issues
- npm.io page: https://npm.io/package/@vee-validate/i18n

## Recent versions

- 4.15.1 (latest) — 2025-06-07
- 4.12.0-alpha.1 (alpha) — 2023-11-05
- 4.5.8 (next) — 2022-01-23
- 4.5.0-alpha.6 (edge) — 2021-08-31
- 4.5.0-alpha.2 (next-edge) — 2021-07-08
- 5.0.0-beta.1 — 2026-03-04
- 5.0.0-beta.0 — 2025-08-02
- 4.15.0 — 2024-12-22
- 4.14.7 — 2024-11-08
- 4.14.6 — 2024-10-26
- 4.14.5 — 2024-10-26
- 4.14.4 — 2024-10-23
- 4.14.3 — 2024-10-18
- 4.14.2 — 2024-10-18
- 4.14.1 — 2024-10-18
- … 123 more at https://npm.io/package/@vee-validate/i18n/versions

## README

# @vee-validate/i18n

<p align="center">
  <a href="https://vee-validate.logaretm.com/v4/guide/i18n" target="_blank">
    <img width="150" src="https://github.com/logaretm/vee-validate/blob/main/logo.png">
  </a>
</p>

> Localization module for vee-validate

## What's this

VeeValidate v4 breaks up the parts that made it a popular solution for form validation into it isolated parts. The core `vee-validate` package no longer includes logic for localization.

This is where this package comes in.

## Installation

```sh
yarn add @vee-validate/i18n

# or with npm
npm install @vee-validate/i18n
```

## Usage

import the `localize()` function from `@vee-validate/i18n` which returns a message generator function:

```js
import { defineRule, configure } from 'vee-validate';
import { required } from '@vee-validate/rules';
import { localize } from '@vee-validate/i18n';

// Define the rule globally
defineRule('required', required);

configure({
  // Generates an English message locale generator
  generateMessage: localize('en', {
    messages: {
      required: 'This field is required',
    },
  }),
});
```

If you have multiple locales in your application, you can add them like this:

```js
import { defineRule, configure } from 'vee-validate';
import { required } from '@vee-validate/rules';
import { localize } from '@vee-validate/i18n';

// Define the rule globally
defineRule('required', required);

configure({
  generateMessage: localize({
    en: {
      messages: {
        required: 'This field is required',
      },
    },
    ar: {
      messages: {
        required: 'هذا الحقل مطلوب',
      },
    },
  }),
});
```

You can change the locale using `setLocale` function exported by the `@vee-validate/i18n` anywhere in your application:

```js
import { setLocale } from '@vee-validate/i18n';

setLocale('ar');
```

## Available Languages

To save you a lot of time translating `@vee-validate/rules` messages to your language, the awesome community around vee-validate already contributed over **40+ languages** that you can use directly in your application and get started quickly. The localized files include localized messages for all the global rules provided by `@vee-validate/rules` package.

You can import the locales from their JSON directory like this:

```js
import { configure } from 'vee-validate';
import { localize } from '@vee-validate/i18n';
import en from '@vee-validate/i18n/dist/locale/en.json';
import ar from '@vee-validate/i18n/dist/locale/ar.json';

configure({
  generateMessage: localize({
    en,
    ar,
  }),
});
```

You can view a list of the available languages by [checking the locale folder](https://github.com/logaretm/vee-validate/tree/main/packages/i18n/src/locale)

---
_Source: https://npm.io/package/@vee-validate/i18n · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
