jackailocal / factory /linux /verify-language-policy.sh
jackboy70's picture
Deploy: accurate lite-builder note
f25362a
Raw
History Blame Contribute Delete
1.02 kB
#!/usr/bin/env bash
set -euo pipefail
ROOT="${1:-$(cd "$(dirname "$0")/../.." && pwd)}"
python3 - "$ROOT" <<'EOF_PY'
from pathlib import Path
import sys
root = Path(sys.argv[1])
paths = list((root / 'docs').glob('*.md')) + [root / 'README_START_HERE.md', root / 'README-FIRST.txt']
terms = ['clé','modèle','démarrer','préparer','réglage','réseau','hors ligne','sauver','rafraîchir','préparation']
accents = set('éèêàùçôîïÉÈÀÇ')
findings = []
for path in paths:
text = path.read_text(encoding='utf-8')
lower = text.lower()
for term in terms:
if term in lower:
findings.append(f'{path.relative_to(root)}: French term found: {term}')
if any(ch in accents for ch in text):
findings.append(f'{path.relative_to(root)}: accented French character found')
if findings:
print('Language policy warning: French text found outside UI.')
print('\n'.join(findings))
raise SystemExit(1)
print('Language policy check passed for docs/root README files.')
EOF_PY