You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP

@intlify/unplugin-vue-i18n

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
b

@intlify/unplugin-vue-i18n

unplugin for Vue I18n

6.0.8
latest
99

Supply Chain Security

100

Vulnerability

100

Quality

90

Maintenance

100

License

Version published
Weekly downloads
348K
-16.19%
Maintainers
2
Weekly downloads
 
Created
Issues
49

What is @intlify/unplugin-vue-i18n?

@intlify/unplugin-vue-i18n is a plugin for Vue.js that provides internationalization (i18n) support. It allows developers to easily manage translations and localization in their Vue applications.

What are @intlify/unplugin-vue-i18n's main functionalities?

Automatic Message Extraction

This feature allows you to automatically extract messages from your Vue components and organize them into locale files. This simplifies the process of managing translations.

```javascript
import { createI18n } from 'vue-i18n';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';

export default defineConfig({
  plugins: [
    vue(),
    VueI18nPlugin({
      include: path.resolve(__dirname, './path/to/locales/**')
    })
  ]
});
```

Dynamic Locale Loading

This feature allows you to dynamically load locale messages only when they are needed. This can help reduce the initial load time of your application.

```javascript
import { createI18n } from 'vue-i18n';

const i18n = createI18n({
  locale: 'en',
  messages: {
    en: () => import('./locales/en.json'),
    fr: () => import('./locales/fr.json')
  }
});

export default i18n;
```

Type-Safe i18n

This feature provides type safety for your i18n messages, ensuring that you catch errors at compile time rather than at runtime.

```typescript
import { createI18n } from 'vue-i18n';
import { defineMessages } from '@intlify/unplugin-vue-i18n/messages';

const messages = defineMessages({
  en: {
    hello: 'Hello'
  },
  fr: {
    hello: 'Bonjour'
  }
});

const i18n = createI18n({
  locale: 'en',
  messages
});

export default i18n;
```

Other packages similar to @intlify/unplugin-vue-i18n

FAQs

Package last updated on 21 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts