Skip to content
CLI & Code Scanning

CLI & Code Scanning: Find Every Untranslated String Automatically

Stop hunting through source files for hardcoded strings. Lefine's CLI uses AST-based parsing to scan your entire codebase, detect untranslated text in JSX components and attributes, report missing and unused keys, and integrate seamlessly into your CI pipeline.

One file, scannedThe scan reads the syntax tree: user-facing text is flagged, class names and paths are not.
01

AST-Powered Code Scanning

Unlike regex-based scanners that produce false positives, Lefine parses your code into an Abstract Syntax Tree for precise, context-aware string detection.

  1. 01Hardcoded String DetectionAutomatically find every user-facing string that is not wrapped in a translation function, including strings in JSX children and component props.
  2. 02AST-Based ParsingParses your source code into an Abstract Syntax Tree for precise, context-aware detection that eliminates the false positives of regex-based scanners.
  3. 03JSX Text Node ScanningDetects untranslated text content inside JSX elements, including expressions and template literals rendered directly in your components.
  4. 04JSX Attribute ScanningFinds hardcoded strings in JSX attributes like placeholder, aria-label, and title that are often missed during manual i18n audits.
  5. 05Smart FilteringIgnores non-translatable values like CSS class names, import paths, and numeric literals so you only see actionable results.
02

CLI Commands for Translation Auditing

The check command provides an interactive, developer-friendly auditing experience. It compares the translation keys used in your source code against the keys stored in Lefine's remote, surfacing both missing keys that need translation and unused keys that can be cleaned up.

Dynamic key patterns like template literals are detected automatically. When your code uses t(`key.${variable}`), the CLI recognizes the dynamic segment and includes it in pattern-matched reports, so nothing slips through the cracks.

  • Run a full translation audit with a single check command
  • Surface missing translation keys that exist in code but not in your remote store
  • Identify unused keys in your remote store that are no longer referenced in code
  • Detect dynamic key patterns like template literals and flag them for review
  • Generate comparison reports between local usage and remote translation state
03

Flexible Output Formats

Scan results are available in multiple formats to fit your workflow. ESLint-style output gives human-readable reports with file, line, and column references. JSON output provides machine-readable data for CI/CD automation and custom tooling.

Verbose mode delivers deep transparency with detailed audit logs, scoping summaries, and timing information. Scan statistics show file counts, discovery metrics, and performance data so you always know the health of your translation coverage.

ESLint-Style Output
Human-readable reports with file path, line number, and column references for fast navigation in any editor.
JSON Output
Machine-readable structured data ideal for CI/CD automation, custom dashboards, and integration with other tooling.
Verbose Mode
Detailed audit logs with scoping summaries, timing information, and namespace resolution traces for debugging.
Scan Statistics
File counts, key discovery metrics, and performance data so you always know the health of your translation coverage.
04

DevOps & CI/CD Integration

Embed translation checks into your existing development pipeline to catch missing strings before they reach production.

  1. 01CI Pipeline IntegrationAdd a scan step to your CI workflow that fails the build when untranslated strings or missing keys are detected.
  2. 02Pre-Commit HooksRun scans on staged files before each commit to catch untranslated strings at the earliest possible point in development.
  3. 03Directory-Scoped ScanningTarget specific directories or file patterns to scan only the parts of your codebase that contain user-facing content.
  4. 04Scope-Aware AnalysisAutomatically resolve translation namespaces through lexical scope tracking so each t() call maps to the correct key set.
05

Lefine CLI: Code Scanning Built for Localization

Lefine's CLI combines AST-based code scanning with remote key management in a single tool. Scan your codebase for hardcoded strings, compare local usage against your remote translation store, detect unused keys that inflate bundle size, and generate reports for your CI pipeline — all without leaving your terminal.

  1. Scope-Aware ScanningTracks useTranslations and getTranslations calls through lexical scopes, binding each t() call to its correct namespace automatically.
  2. Server Component SupportFull support for Next.js App Router async server components, so getTranslations calls in server code are detected and audited alongside client-side usage.
  3. Pre-Commit HooksRun scans on staged files only with the --staged flag, catching untranslated strings before they are committed without slowing down your workflow.
Get started

Start free.

Ship Translations Without Missing a String

Lefine's CLI scans your code, detects every untranslated string, and fits into your CI pipeline so nothing reaches production without a translation.