-
Notifications
You must be signed in to change notification settings - Fork 667
Open
Labels
Description
Summary
Add a dedicated check command that exits with non-zero code when translations need updating, replacing the lingo.dev i18n --frozen functionality we're deprecating in the future (in favor of run command).
Requirements
- Create new
checkcommand that validates translation state without making changes - Reuse
runcommand's setup and plan phases - Exit with code 1 if plan phase generates any tasks (tasks.length > 0)
- Exit with code 0 if no tasks needed (everything up-to-date)
- Display summary of what needs updating before exiting
Implementation
Core Approach
The check and run commands should reuse the common logic.
Key Benefits
- Zero duplication: Reuses all validation logic
- Consistency: Same detection logic as actual translation process
- Maintainability: Single source of truth for what needs updating
- Simplicity: ~50 lines of code instead of reimplementing validation
Task Detection
The run command's plan phase already creates tasks for:
- Source file changes (checksum mismatches)
- Missing translations
- New locales
- Configuration changes
By checking tasks.length > 0, we detect all these cases automatically.
Example Usage
# CI/CD pipeline
- name: Check translations
run: `npx lingo.dev@latest check`
# Fails pipeline if translations need updating