<commit_before>#! /bin/sh -x

extract_django() {
    DIR=$1

    if [ -d ${DIR} ]
    then    
	pushd ${DIR}
	TEMPLANG=foobar
	django-admin.py makemessages --no-wrap -l ${TEMPLANG} -e html,txt,js
	# Remove the creation date to avoid spurious commits
	grep -v "POT-Creation-Date:" locale/${TEMPLANG}/LC_MESSAGES/django.po > locale/django.pot
	rm -rf locale/${TEMPLANG}
	popd
    fi
}

# Try to extract keys no matter where we are
[ -d www ]    && extract_django www
[ -d ../www ] && extract_django ../www

# Push keys to transifex
tx push --no-interactive --source<commit_msg>Updated message key extraction script<commit_after>#! /bin/sh -x

extract_django() {
    DIR=$1

    if [ -d ${DIR} ]
    then    
	pushd ${DIR}
	TEMPLANG=foobar
	django-admin.py makemessages --no-wrap -l ${TEMPLANG}
	# Remove the creation date to avoid spurious commits
	grep -v "POT-Creation-Date:" locale/${TEMPLANG}/LC_MESSAGES/django.po > locale/django.pot
	rm -rf locale/${TEMPLANG}
	popd
    fi
}

# Try to extract keys no matter where we are
[ -d www ]    && extract_django www
[ -d ../www ] && extract_django ../www

# Push keys to transifex
tx push --no-interactive --source
{'fraction_non_alphanumeric': 0.1371872303710095, 'fraction_numerical': 0.001725625539257981, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3497791', 'n_tokens_mistral': 423, 'n_tokens_neox': 413, 'n_words': 125}