i18n Kit
A reusable Vue 3 localization plugin that wraps vue-i18n and provides a ready-to-use integration layer — set up once, reuse across every project in your team.
Features
- One-liner setup — install the plugin in
main.tsand start using composables immediately - Two-method translation API —
t(key, vars?)for simple strings,tm(key, vars)for ICU-pluralized strings; both fromuseT() - ICU pluralization —
Intl.PluralRules-based with named CLDR categories (one,few,many, …); correct for every language including Arabic (6 forms) - Lazy loading — locale JSON files are fetched on demand; only the active locale is loaded at startup
- Namespace code splitting — split large locale files by feature and lazy-load namespaces on demand with
useNamespace() - Persist locale — selected language is automatically saved to
localStorageand restored on next visit - Fallback locale — missing translation keys transparently fall back to the configured fallback language
- Locale metadata — attach any custom data to a locale (
display,flag,author, …) and read it back throughuseLocaleanduseAvailableLocales - Date / number / currency formatting —
useFormatwrapsIntland always uses the active locale - Plugin service —
createVueI18nPluginreturns anI18nPluginwith a.serviceproperty — fully usable outside Vue components (router guards, Pinia stores, SSR entry points) - Locale change hook —
service.onLocaleChange(cb)fires after every successful locale switch; returns an unsubscribe function - TypeScript-first — all public APIs are fully typed, no
anyleaks into consumer code - Vite check plugin — checks all locale files for missing or extra keys at build time (import from
vue-i18n-kit/vite) - Vite inline plugin —
vueI18nInlinePluginbakes all locale JSON into the bundle as a static virtual module — zero HTTP requests at runtime - Vite namespace plugin —
vueI18nNamespacePluginscans split locale directories and generates a virtual module with per-namespace dynamic imports - In-context translation editor —
vueI18nDevPluginoverlays a pencil icon on every translated string during development; click to edit inline - CLI —
vue-i18n-kit init / add / check / merge / prunescaffolds, audits, and cleans locale files from the terminal - Dictionary merge —
vue-i18n-kit mergedeep-merges a shared/corporate base dictionary into project locale files - Dead key pruning —
vue-i18n-kit pruneremoves keys not referenced anywhere in the source code - Base dictionary (extends) —
extendsfield ini18n-kit.config.jsonloads a shared locale directory and merges it under project keys - Locked keys — declare immutable keys in the base config; editor shows them read-only, server rejects edits with 403, CLI tools never touch them
- Validation rules — configure
rulesini18n-kit.config.jsonto tune length thresholds, placeholder patterns, HTML/ICU warnings per project - Ignore lists —
ignore.prune,ignore.duplicates,ignore.unused,ignore.scanExcludewhitelists protect dynamic keys, brand names, and test files - Alphabetical merge —
mergenow always sorts output keys alphabetically (likesort); use--no-sortto opt out - TypeScript type generation —
vue-i18n-kit typesgenerates aTranslationKeyunion type from locale files;--watchmode regenerates on change - Stale translation detection — tracks when reference values change and flags translations in other locales as outdated; CLI
stalecommand + editor filter + "Mark as reviewed" button - XLIFF / PO export —
vue-i18n-kit exportgenerates industry-standard XLIFF 1.2 or Gettext PO files for professional translators; translator notes are included - XLIFF / PO import —
vue-i18n-kit importreads completed XLIFF or PO files back into locale JSON - Coverage report —
vue-i18n-kit statsprints fill rate per locale and namespace to the console;--format jsonfor CI pipelines;--format htmlfor a self-contained visual report - Machine translation — auto-translate missing keys via LibreTranslate or DeepL (500k chars/month free); ICU placeholders and plurals are encoded as opaque XML tags so they survive translation intact
- Locale Editor UI — browser-based editor with dashboard, inline editing, group operations, phantom key detection, plural preview, stale filter, XLIFF/PO export-import, and more