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:
counterweight 2025-12-26 11:58:09 +01:00
parent 2fdcbbdfe8
commit 63a4b0f8a2
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
2 changed files with 164 additions and 0 deletions

View file

@ -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"