зеркало из
1
0
Форкнуть 0

fix(email): add a script to send a string update message to the l10n list

This commit is contained in:
Zachary Carter 2015-07-16 11:27:58 -07:00
Родитель 970d597b2a
Коммит 6f65badf7d
3 изменённых файлов: 78 добавлений и 0 удалений

53
scripts/email-dev-l10n.sh Executable file
Просмотреть файл

@ -0,0 +1,53 @@
# Script adapted from https://github.com/mozilla/olympia/blob/master/locale/omg_new_l10n.sh
EMAIL_FROM="Firefox Accounts Developers <dev-fxacct@mozilla.org>"
EMAIL_TO="Awesome Localizers <dev-l10n-web@lists.mozilla.org>"
EMAIL_SUBJECT="[FxA] .po files updated"
# A link to the .po files
EMAIL_SOURCE="https://github.com/mozilla/fxa-content-server-l10n/tree/master/locale"
VERBATIM_URL="https://localize.mozilla.org/projects/accounts"
SCRIPT_DIR=`dirname "$0"`
LOCALE_DIR=$SCRIPT_DIR/../locale
echo $DIR
echo $SCRIPT_DIR
echo $PWD
echo "Calculating changes...."
CHANGES=$(cat <<MAIL
From: $EMAIL_FROM
To: $EMAIL_TO
Subject: $EMAIL_SUBJECT
Hi,
I am an automated script letting you know that some .po files have just been
updated. Unless something unusual is happening, we do bi-weekly pushes every other
Wednesday so any strings committed by then will go live. To give you an idea of
the number of new strings I will calculate untranslated strings below.
`$SCRIPT_DIR/stats-po.sh $LOCALE_DIR`
Verbatim: $VERBATIM_URL
Source files: $EMAIL_SOURCE
If you have any questions please reply to the list.
Thanks so much for all your help!
MAIL
)
echo "-----------------------------------------------"
echo "$CHANGES"
echo "-----------------------------------------------"
# Uses sendmail so we can set a real From address
read -p "Do you want to send that to $EMAIL_TO? (y/n)" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "$CHANGES" | `which sendmail` -t
echo "Email sent."
else
echo "No email sent. Bye."
fi

Просмотреть файл

@ -85,3 +85,6 @@ echo
echo "Everything seems to be in order. Please check the extraction went okay then you can push the new branch with:" echo "Everything seems to be in order. Please check the extraction went okay then you can push the new branch with:"
echo "cd $L10N_DIR" echo "cd $L10N_DIR"
echo "git push <remote> merge-train-$TRAIN_NUMBER-strings" echo "git push <remote> merge-train-$TRAIN_NUMBER-strings"
echo
echo "When the strings have been merged, send an email to the l10n list by running:"
echo "./scripts/email-l10n-dev.sh"

22
scripts/stats-po.sh Executable file
Просмотреть файл

@ -0,0 +1,22 @@
#! /usr/bin/env bash
# syntax:
# stats-po.sh
echo "Printing number of untranslated strings found in locales:"
for lang in $(find $1 -type f -name "server.po" | sort); do
dir=$(dirname $lang)
lang_dir=$(dirname $dir)
stem=$(basename $lang .po)
js="$dir/client.po"
count=$(msgattrib $lang --untranslated --no-obsolete --no-fuzzy | grep -c 'msgid ')
if [ $count -gt 0 ]; then
count=$(($count-1))
fi
count2=$(msgattrib $js --untranslated --no-obsolete --no-fuzzy | grep -c 'msgid ')
if [ $count2 -gt 0 ]; then
count2=$(($count2-1))
fi
echo -e "${lang_dir##*/}\t\tserver=$count\tclient=$count2"
done