<commit_before>#! /bin/sh -x

# Pull translations from transifex
tx pull --force

# Commit any changes
# git diff

git config user.email "<EMAIL>"
git config user.name "<NAME>"

git add scripts/transifex-fetch-translations.sh
git commit -m "Updated message translation fetching script" scripts/transifex-fetch-translations.sh

# Loop over all translations
for translation in $(find www/locale -name \*.po)
do
    # Set sane defaults for attribution
    git config user.email "<EMAIL>"
    git config user.name "Transifex Daemon"

    # Try hard to attribute git commits to translators
    LAST_TRANSLATOR=$(grep Last-Translator: ${translation} | head -n 1)
    if [ $? == 0 ]
    then
	LAST_TRANSLATOR=$(echo ${LAST_TRANSLATOR} | sed -e 's/\"Last-Translator: //')
	LAST_TRANSLATOR=$(echo ${LAST_TRANSLATOR} | sed -e 's/\\n\"//')
	USER_EMAIL=$(echo ${LAST_TRANSLATOR} | sed -e 's/.*<//' | sed -e 's/>$//')
	USER_NAME=$(echo ${LAST_TRANSLATOR} | sed -e 's/ <.*>//')<commit_msg>Updated message translation fetching script<commit_after>#! /bin/sh -x

# Pull translations from transifex
tx pull

# Commit any changes
# git diff

git config user.email "<EMAIL>"
git config user.name "<NAME>"

git add scripts/transifex-fetch-translations.sh
git commit -m "Updated message translation fetching script" scripts/transifex-fetch-translations.sh

# Loop over all translations
for translation in $(find www/locale -name \*.po)
do
    # Set sane defaults for attribution
    git config user.email "<EMAIL>"
    git config user.name "Transifex Daemon"

    # Try hard to attribute git commits to translators
    LAST_TRANSLATOR=$(grep Last-Translator: ${translation} | head -n 1)
    if [ $? == 0 ]
    then
	LAST_TRANSLATOR=$(echo ${LAST_TRANSLATOR} | sed -e 's/\"Last-Translator: //')
	LAST_TRANSLATOR=$(echo ${LAST_TRANSLATOR} | sed -e 's/\\n\"//')
	USER_EMAIL=$(echo ${LAST_TRANSLATOR} | sed -e 's/.*<//' | sed -e 's/>$//')
	USER_NAME=$(echo ${LAST_TRANSLATOR} | sed -e 's/ <.*>//')
{'fraction_non_alphanumeric': 0.1511156186612576, 'fraction_numerical': 0.002028397565922921, 'mean_word_length': 3.7427884615384617, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2352012', 'n_tokens_mistral': 682, 'n_tokens_neox': 663, 'n_words': 205}