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

i18n-audit-webpack-plugin

v1.1.7

Published

Static i18n auditing tool for monorepos that detects missing translations, placeholder mismatches, and localization issues.

Readme

i18n-audit-webpack-plugin

Webpack plugin for static i18n locale auditing (useful for monorepos and single apps): detects missing locale files, missing/extra keys, {{…}} placeholder mismatches across languages, plus optional line-based heuristics (JP/style).

If you find this plugin useful, please consider supporting me via GitHub Sponsors, Patreon, KO-FI or PayPal. Thank you!

Github Patreon KO-FI Paypal


✨ Features

  • Key parity: compares key trees between corresponding locale files and reports missing / extra keys.
  • {{…}} placeholders: detects placeholder name mismatches for the same key across locales (e.g. {{name}} vs {{fullName}}).
  • Missing locale files: if the base locale file exists but the matching file is missing in another locale.
  • Optional heuristics (Japanese/copy-style focused): line-based rules like long English strings, 。./.。, ASCII . after Japanese, ASCII ? after Japanese, \u00A0, template literals `${…}` inside locale files, etc.
  • ✅ Works with Webpack 1 → 5 (peerDependency).

📦 Installation

npm i -D i18n-audit-webpack-plugin

🚀 Usage (Webpack)

CommonJS (webpack.config.js)

const I18nAuditWebpackPlugin = require('i18n-audit-webpack-plugin');

module.exports = {
  plugins: [
    new I18nAuditWebpackPlugin({
      failOnError: true,
      outputFile: 'reports/i18n-audit.txt',
      heuristicLangs: ['ja', 'jp']
    })
  ]
};

ESM (webpack.config.mjs)

import I18nAuditWebpackPlugin from 'i18n-audit-webpack-plugin';

export default {
  plugins: [
    new I18nAuditWebpackPlugin({
      failOnError: true,
      outputFile: 'reports/i18n-audit.txt',
      heuristicLangs: ['ja'],
      useColors: true
    })
  ]
};

📁 Locale folder convention (what the plugin scans)

By default, the plugin scans files matching:

  • **/locales/*/**/*.{ts,tsx}

Where locales/<lang>/... is the locale folder code (e.g. en, vi, ja).

Example:

src/locales/en/common.ts
src/locales/vi/common.ts
packages/app/locales/en/errors.ts
packages/app/locales/ja/errors.ts

✅ Supported locale file format

The plugin parses TypeScript AST and prefers:

  • export default { ... }
  • or export const X = { ... } (an exported object literal)

Example:

export default {
  common: {
    hello: 'Hello {{name}}'
  }
};

📝 What’s in the report?

The report has up to 3 sections (depending on options):

  1. Key parity: locale file pairs that have missing/extra keys.
  2. Placeholders: keys whose {{…}} placeholders differ between the base locale and another locale.
  3. Heuristics: lines “flagged” by the heuristics rules (if enabled).

By default, the report is printed to the console after a Webpack build (hooked at finishModules).


⚙️ Options

Public plugin options:

  • failOnError (boolean, default false): pushes an error into the compilation when issues are found (fails build/CI).
  • outputFile (string | undefined): when set, writes a plain-text report to a file (path relative to compiler.context (build root) or absolute).
  • projectRoot (string | undefined): repo/app root to scan. If not set, the plugin walks up from compiler.context and stops at the first marker found: .git, pnpm-workspace.yaml, lerna.json, rush.json.
  • logToConsole (boolean, default true): enable/disable writing the report to stdout.
  • useColors (boolean, default: true when stdout is a TTY and NO_COLOR is not set): enable/disable ANSI colors in console output.
  • heuristicLangs (string[], default []): locale folder codes to run heuristics on (only runs for languages that exist in the repo; matching is case-insensitive).

📌 Important notes

  • The plugin picks a base language automatically: prefers en if present; otherwise uses the first detected language.
  • Each “file pair” is matched by the same relative path under locales/<lang>/... (e.g. locales/en/common.tslocales/vi/common.ts).
  • If a locale file uses patterns that are hard to parse (not exporting an object literal), the report will show a parse error and skip deeper comparisons for that pair.
  • In watch mode, the audit runs on each build; in non-watch mode, the plugin dedupes runs for the same projectRoot + globs.

📄 License

MIT © 2026 Nguyen Ngoc Long