Skip to content

translify audit

Run a full i18n health audit — every check in one pass.

Usage

bash
translify audit
translify audit --verbose
translify audit --config ./config/translify.config.ts
translify audit --output report.json

What it checks

CheckDescription
Missing keysKeys used in source but absent from translation files
Unused keysKeys in translation files never referenced in code
Duplicate valuesMultiple keys sharing the same translated string
Duplicate keysThe same key declared twice in one raw JSON file
Locale inconsistenciesA key present in one locale but missing from another
Hardcoded textUser-facing text not wrapped in translation calls

Example output

▸ Translify Audit 2024-01-15T10:30:00.000Z

▸ Overview
  Source files         42
  Translation files    3
  Unique keys used     187

▸ Checks
  Check                   Issues
  ──────────────────────  ──────
  Missing keys            0
  Unused keys             12
  Duplicate values        0
  Duplicate keys          0
  Locale inconsistencies  2
  Hardcoded text          3

▸ Unused keys
  ⚠ [en] old.navbar.home
  ⚠ [en] deprecated.footer.link


⚠ Audit found 17 issues. Review the output above.

Exit code

  • 0 — all checks passed
  • 1 — one or more issues found

This makes it safe to use in CI pipelines:

yaml
- run: npx @ndnci/translify@latest audit

Options

OptionDescription
-c, --configPath to config file
--cwdWorking directory
--verboseShow all details
--output <file>Write the full report to a file (.json or plain text)

Notes

For split translation projects, all files for the same language are treated as one logical catalogue. For example, messages/en/auth.json and messages/en/tools.json are checked together before Translify reports a key as missing from en.

Released under the MIT License.