1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

i18n: move translation checking to pre-commit hook

This commit is contained in:
bbedward
2025-11-06 12:37:26 -05:00
parent d9652c7334
commit 4ddcf4391a
6 changed files with 433 additions and 259 deletions

27
.githooks/pre-commit Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
set -euo pipefail
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$HOOK_DIR/.." && pwd)"
cd "$REPO_ROOT"
if [[ -z "${POEDITOR_API_TOKEN:-}" ]] || [[ -z "${POEDITOR_PROJECT_ID:-}" ]]; then
echo "Skipping i18n sync check (POEDITOR_API_TOKEN or POEDITOR_PROJECT_ID not set)"
exit 0
fi
if ! command -v python3 &>/dev/null; then
echo "Warning: python3 not found, skipping i18n check"
exit 0
fi
if ! python3 scripts/i18nsync.py check 2>&1; then
echo ""
echo "Run: python3 scripts/i18nsync.py sync"
echo ""
exit 1
fi
exit 0