#!/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