gitg/po/update-potfiles
2012-07-17 10:58:11 +02:00

32 lines
745 B
Bash
Executable file

#!/bin/bash
top=$(git rev-parse --show-toplevel)
allfiles=$(cd "$top" && git ls-files --no-empty-directory --exclude-standard | sort)
echo "# List of source files containing translatable strings."
echo "# This list has been automatically generated by update-potfiles."
echo "[encoding: UTF-8]"
# Desktop in files
for i in $allfiles;
do
if [ ${i##*.} == "in" ] && grep -E '(^_|<_)' "$top/$i" &>/dev/null; then
echo $i;
fi
done
# vala source files
for i in $allfiles;
do
if [ ${i##*.} == "vala" ] && grep -E '_\(["'"'"']' "$top/$i" &>/dev/null; then
echo $i;
fi
done
# gtkbuilder ui files
for i in $allfiles;
do
if [ ${i##*.} == "ui" ] && grep -E 'translatable' "$top/$i" &>/dev/null; then
echo "[type: gettext/glade]$i";
fi
done