From 6f65badf7d6cffe324e1d4a767a7aea17a076c13 Mon Sep 17 00:00:00 2001 From: Zachary Carter Date: Thu, 16 Jul 2015 11:27:58 -0700 Subject: [PATCH] fix(email): add a script to send a string update message to the l10n list --- scripts/email-dev-l10n.sh | 53 ++++++++++++++++++++++++++++++++++++++ scripts/extract_strings.sh | 3 +++ scripts/stats-po.sh | 22 ++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100755 scripts/email-dev-l10n.sh create mode 100755 scripts/stats-po.sh diff --git a/scripts/email-dev-l10n.sh b/scripts/email-dev-l10n.sh new file mode 100755 index 0000000000..5bfa5a294c --- /dev/null +++ b/scripts/email-dev-l10n.sh @@ -0,0 +1,53 @@ +# Script adapted from https://github.com/mozilla/olympia/blob/master/locale/omg_new_l10n.sh + +EMAIL_FROM="Firefox Accounts Developers " +EMAIL_TO="Awesome Localizers " +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 < 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" diff --git a/scripts/stats-po.sh b/scripts/stats-po.sh new file mode 100755 index 0000000000..089294faa6 --- /dev/null +++ b/scripts/stats-po.sh @@ -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