Add translation validation git hook
- Create validate-translations.js script to check all translation keys exist in all locales - Add translation validation to pre-commit hook - Validates that es, en, ca translation files have matching keys - Blocks commits if translations are missing or inconsistent - Prevents incomplete translations from being committed
This commit is contained in:
parent
2fdcbbdfe8
commit
63a4b0f8a2
2 changed files with 164 additions and 0 deletions
|
|
@ -36,6 +36,19 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "🔍 Validating translation files..."
|
||||
|
||||
# Check if any translation files are staged
|
||||
if git diff --cached --name-only | grep -q "frontend/locales/"; then
|
||||
# Run translation validation
|
||||
if ! node scripts/validate-translations.js; then
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "✓ No translation files staged, skipping validation"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "✅ All pre-commit checks passed"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue