Skip to content

Conversation

@Axshatt
Copy link

@Axshatt Axshatt commented Nov 1, 2025

Adds a new CLI command to Lingo.dev that reports translation coverage across all locales — helping developers and localization teams quickly spot missing translations before release.

✨ Features

New command:
npx lingo.dev@latest show stats

Scans locale files and computes:

Total / Translated / Missing keys per locale

Coverage % with color indicators

🟢 ≥90% 🟡 ≥70% 🔴 <70%

Lists missing keys grouped by locale and file

Non-blocking (exit code 0)

🛠 Implementation

Added packages/cli/src/commands/show/stats.ts

Registered under the show command group

Added utilities in i18n.ts for file discovery + key flattening

Added tests for key counting and missing-key detection

Updated CLI help and README with examples

🔮 Next Steps

Support additional formats (YAML, PO, TS)

Add --ref-locale flag

Option to fail CI on low coverage

✅ Compatibility

Additive change , no breaking updates to existing commands or APIs.

@Axshatt Axshatt changed the title Add show stats CLI command to generate translation coverage reports Add show stats CLI command to generate translation coverage reports (#1502) Nov 1, 2025
Copilot finished reviewing on behalf of maxprilutskiy November 12, 2025 02:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new CLI command npx lingo.dev@latest show stats to generate translation coverage reports across all locales. The command scans locale files, counts total and translated keys, calculates coverage percentages with color-coded indicators, and lists missing translation keys grouped by locale and file.

Key Changes

  • Added new stats.ts command under the show command group
  • Registered the stats command in the show index
  • Added lingo.dev package dependency to root package.json

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 12 comments.

File Description
packages/cli/src/cli/cmd/show/stats.ts Implements the new stats command with translation coverage calculation and reporting
packages/cli/src/cli/cmd/show/index.ts Registers the stats command with the show command group
package.json Adds lingo.dev as a dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sumitsaurabh927
Copy link
Contributor

@Axshatt are you interested in continuing?

@sumitsaurabh927
Copy link
Contributor

Closing as unresponsive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants