translint
v0.3.1
Published
Premium i18n quality checker with CLI, scoring, and HTML report.
Maintainers
Readme
Translint
The ESLint of translations.
Premium i18n quality tooling for modern projects. Detect missing keys, unused translations, placeholder mismatches, and generate a premium HTML report your team will actually want to open.
Why Translint
Translation quality should be as enforceable as code quality. This tool brings a lint-like workflow to i18n, with clear feedback, CI-friendly output, and a premium report you can share.
Most translation checks are brittle or noisy. This tool focuses on real issues, clean output, and useful reports that can be used in CI and shared with teams.
What you get:
- Missing, extra, unused keys
- Empty/null values, same-as-key values
- Placeholder mismatches and structural inconsistencies
- Dynamic key warnings
- Quality score with breakdowns
- Premium standalone HTML audit report
- Auto-fix and sync modes for safe remediation
Quickstart
Run with npx
npx -y translint checkInstall
npm install -D translintSetup wizard (recommended)
npx -y translint initThe wizard auto-detects your project structure, asks the right questions, and generates
translint.config.js.
CLI Commands
check
Analyze and print issues.
translint check --format json --fail-on-errorreport
Generate a premium HTML report.
translint report --output i18n-report.html --openscore
Compute and print the quality score.
translint scorefix
Apply safe fixes (add missing keys, optionally remove unused).
translint fix --source-lang en --strategy todo --sortsync
Synchronize all locales from the source language.
translint sync --source-lang en --strategy sourceCommon Options (all commands)
--config <path>: Path to config file--src <path>: Source directory or glob (repeatable)--locales <path>: Locales root directory--source-lang <code>: Reference language--ignore <pattern>: Ignore glob (repeatable)--verbose: Verbose output
Check-specific options
--format <pretty|json>--fail-on-error--framework <auto|i18next|next-intl|react-intl|angular>--include-dynamic-warnings
Report-specific options
--output <path>--open
Fix/Sync options
--strategy <empty|source|todo>--dry-run--sort--remove-unused(fix only)
Configuration
Config file: translint.config.js (or .json, .ts)
module.exports = {
projectRoot: process.cwd(),
source: ['src'],
locales: {
dir: 'src/i18n',
extension: '.json',
fileName: 'trad',
sourceLang: 'en',
},
patterns: {
prefix: 'trad.',
functions: ['t', 'i18n.t', 'translate.instant', 'this.translate.instant'],
},
ignore: ['**/node_modules/**', '**/dist/**', '**/.git/**', '**/coverage/**'],
rules: {
detectEmpty: true,
detectNull: true,
detectSameAsKey: true,
detectUnused: true,
detectDuplicateTranslations: true,
detectPlaceholderMismatch: true,
detectStructureMismatch: true,
},
report: {
title: 'i18n Quality Report',
darkMode: true,
},
fix: {
strategy: 'todo',
placeholder: 'TODO_TRANSLATE',
sort: true,
},
};If you decide not to auto-load config during init, run:
translint check --config path/to/translint.config.jsAST Coverage
Currently supported call patterns:
t('key')i18n.t('key')translate.instant('key')this.translate.instant('key')
Literal trad.* strings are also detected.
Report Output
The HTML report is a single, portable file with:
- KPI cards
- Score ring
- Severity badges
- Detailed issues table
- Recommendations
CI Example
translint check --format json --fail-on-errorRoadmap
- Framework adapters (Next.js, react-intl, angular templates)
- Pluralization consistency
- Richer dynamic key inference
- Report theming and branding
License
MIT
