<commit_before>#!/bin/bash
set -o errexit

# NAME
#     update_defaults
#
# SYNOPSIS
#     ./update_defaults.sh
# 
# DESCRIPTION
#     Uses *_en.po translations to rebuild default translations in Java
#     .properties format resource bundles.
#
# OPTIONS
#     None.

# NOTE: leave the "grep -v" until existing locale-specific bundles are
# converted into .po files in their respective directories
defaults=`\ls *.properties | grep -v _`

for bundle in $defaults
do
    bundleBase=`basename $bundle .properties`
    # blow away pootle's "memory"... it may interfere with default strings
    sed -e '/^#~.*/d' $bundle > $bundle.copy
    cp $bundle.copy $bundle
    po2prop -t $bundle en/${bundleBase}_en.po > $bundle.copy
    mv $bundle.copy $bundle
done<commit_msg>fixed default updates using additional logic to manipulate .po files<commit_after>#!/bin/bash
set -o errexit

# NAME
#     update_defaults
#
# SYNOPSIS
#     ./update_defaults.sh
# 
# DESCRIPTION
#     Uses *_en.po translations to rebuild default translations in Java
#     .properties format resource bundles.
#
# OPTIONS
#     None.

# NOTE: leave the "grep -v" until existing locale-specific bundles are
# converted into .po files in their respective directories
defaults=`\ls *.properties | grep -v _`

for bundle in $defaults
do
    bundleBase=`basename $bundle .properties`
    en_po="${bundleBase}_en.po"

    # blow away pootle's "memory"... it may interfere with default strings
    sed -e '/^#~.*/d' en/$en_po > $en_po.copy
    mv $en_po.copy en/$en_po

    po2prop -t $bundle en/$en_po > $bundle.copy
    mv $bundle.copy $bundle

    prop2po $bundle > en/$en_po

    ./locale_sync.sh
done
{'fraction_non_alphanumeric': 0.11291291291291292, 'fraction_numerical': 0.0018018018018018018, 'mean_word_length': 3.2177215189873416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3435558', 'n_tokens_mistral': 570, 'n_tokens_neox': 522, 'n_words': 175}