npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-i18n-audit

v1.0.0

Published

CLI tool to audit Vue.js applications for i18n translation completeness. Detects missing translations and hardcoded text.

Readme

vue-i18n-audit

npm version License: MIT

A CLI tool for auditing Vue.js applications for i18n translation completeness. Detects missing translations and hardcoded user-visible text that should be internationalized.

Features

  • Translation Key Coverage - Verifies every t('key') and $t('key') call has a corresponding translation
  • Hardcoded Text Detection - Identifies user-visible text in templates that should use i18n
  • Dynamic Key Flagging - Flags template literals like t(`status.${value}`) for manual review
  • Confidence Scoring - Rates hardcoded text detection (high/medium/low) to reduce false positives
  • Multiple Output Formats - Markdown reports for humans, JSON for CI integration
  • CI/CD Ready - Exit codes and threshold options for pipeline integration

Installation

# npm
npm install -D vue-i18n-audit

# pnpm
pnpm add -D vue-i18n-audit

# yarn
yarn add -D vue-i18n-audit

Peer Dependencies

This package requires the following peer dependencies (usually already in Vue 3 projects):

npm install -D @babel/parser @vue/compiler-sfc

Usage

Run Full Audit

# Generate markdown report
npx vue-i18n-audit audit

# With options
npx vue-i18n-audit audit \
  --pages-dir src/pages \
  --locales-dir src/locales/en \
  --output i18n-audit-report.md \
  --verbose

# JSON output
npx vue-i18n-audit audit --json

CI Check Mode

# Fail if more than 0 missing translations
npx vue-i18n-audit check

# Allow up to 10 issues
npx vue-i18n-audit check --threshold 10

# Also fail on hardcoded text
npx vue-i18n-audit check --fail-on-hardcoded

List Translation Keys

# List all unique keys used in Vue files
npx vue-i18n-audit list-keys

# Output as JSON
npx vue-i18n-audit list-keys --format json

# Show all occurrences (not just unique)
npx vue-i18n-audit list-keys --no-unique

npm Scripts

Add to your package.json:

{
  "scripts": {
    "i18n:audit": "vue-i18n-audit audit",
    "i18n:check": "vue-i18n-audit check",
    "i18n:keys": "vue-i18n-audit list-keys"
  }
}

Configuration

Create .i18n-audit.config.json in your project root:

{
  "pagesDir": "resources/js/Pages",
  "localesDir": "resources/js/i18n/locales/en",
  "includePartials": true,
  "outputFile": "i18n-audit-report.md",
  "excludePatterns": ["**/node_modules/**", "**/*.test.vue"],
  "hardcodedTextRules": {
    "minLength": 3,
    "excludeAllCaps": true,
    "excludePatterns": ["^v-", "^@", "^:", "^#"]
  }
}

CLI Options

audit command

| Option | Default | Description | |--------|---------|-------------| | -o, --output <path> | i18n-audit-report.md | Output file path | | -p, --pages-dir <path> | resources/js/Pages | Vue pages directory | | -l, --locales-dir <path> | resources/js/i18n/locales/en | English locale directory | | --include-partials | true | Include Partials/ subdirectories | | --json | false | Output JSON instead of markdown | | -v, --verbose | false | Show detailed output |

check command

| Option | Default | Description | |--------|---------|-------------| | -t, --threshold <n> | 0 | Max allowed issues before failure | | --fail-on-missing | true | Exit with error on missing translations | | --fail-on-hardcoded | false | Exit with error on hardcoded text |

list-keys command

| Option | Default | Description | |--------|---------|-------------| | -f, --format <fmt> | text | Output format: text, json, csv | | -u, --unique | true | Only show unique keys |

Exit Codes

| Code | Meaning | |------|---------| | 0 | Success (no issues or within threshold) | | 1 | Issues found exceeding threshold | | 2 | Invalid arguments | | 3 | File/parsing error |

How It Works

Translation Key Detection

The tool detects translation keys in:

Templates:

<template>
  {{ t('common.save') }}
  {{ $t('common.cancel') }}
  <span :title="t('tooltip.help')">Help</span>
</template>

Scripts:

<script setup>
const { t } = useI18n()
const message = t('notifications.success')
</script>

Hardcoded Text Detection

Identifies text content between HTML tags:

<!-- Flagged as hardcoded (high confidence) -->
<h1>Welcome to Dashboard</h1>
<button>Save Changes</button>

<!-- Not flagged (technical content) -->
<div class="flex-container">
<Icon name="check" />

Locale File Format

Supports TypeScript locale files with nested objects:

// locales/en/common.ts
export default {
  save: 'Save',
  cancel: 'Cancel',
  actions: {
    edit: 'Edit',
    delete: 'Delete'
  }
}

Keys are flattened to dot notation: common.save, common.actions.edit

Sample Report

# i18n Translation Audit Report

## Summary

| Metric | Count |
|--------|-------|
| Files Scanned | 138 |
| Unique Keys | 764 |
| Missing Translations | 12 |
| Hardcoded Strings | 45 |
| Coverage | 98.4% |

## Missing Translations

| File | Line | Key |
|------|------|-----|
| Pages/Dashboard.vue | 42 | dashboard.welcome |
| Pages/Settings.vue | 18 | settings.title |

License

MIT

Contributing

Contributions welcome! Please open an issue or PR.