Skip to content

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.ts and start using composables immediately
  • Two-method translation API — t(key, vars?) for simple strings, tm(key, vars) for ICU-pluralized strings; both from useT()
  • 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 localStorage and 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 through useLocale and useAvailableLocales
  • Date / number / currency formatting — useFormat wraps Intl and always uses the active locale
  • Plugin service — createVueI18nPlugin returns an I18nPlugin with a .service property — 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 any leaks 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 — vueI18nInlinePlugin bakes all locale JSON into the bundle as a static virtual module — zero HTTP requests at runtime
  • Vite namespace plugin — vueI18nNamespacePlugin scans split locale directories and generates a virtual module with per-namespace dynamic imports
  • In-context translation editor — vueI18nDevPlugin overlays a pencil icon on every translated string during development; click to edit inline
  • CLI — vue-i18n-kit init / add / check / merge / prune scaffolds, audits, and cleans locale files from the terminal
  • Dictionary merge — vue-i18n-kit merge deep-merges a shared/corporate base dictionary into project locale files
  • Dead key pruning — vue-i18n-kit prune removes keys not referenced anywhere in the source code
  • Base dictionary (extends) — extends field in i18n-kit.config.json loads 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 rules in i18n-kit.config.json to tune length thresholds, placeholder patterns, HTML/ICU warnings per project
  • Ignore lists — ignore.prune, ignore.duplicates, ignore.unused, ignore.scanExclude whitelists protect dynamic keys, brand names, and test files
  • Alphabetical merge — merge now always sorts output keys alphabetically (like sort); use --no-sort to opt out
  • TypeScript type generation — vue-i18n-kit types generates a TranslationKey union type from locale files; --watch mode regenerates on change
  • Stale translation detection — tracks when reference values change and flags translations in other locales as outdated; CLI stale command + editor filter + "Mark as reviewed" button
  • XLIFF / PO export — vue-i18n-kit export generates industry-standard XLIFF 1.2 or Gettext PO files for professional translators; translator notes are included
  • XLIFF / PO import — vue-i18n-kit import reads completed XLIFF or PO files back into locale JSON
  • Coverage report — vue-i18n-kit stats prints fill rate per locale and namespace to the console; --format json for CI pipelines; --format html for 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