File: update-potfiles

package info (click to toggle)
gitg 3.30.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 18,520 kB
  • sloc: ansic: 1,635; ruby: 1,466; sh: 314; python: 259; xml: 121; makefile: 40
file content (32 lines) | stat: -rwxr-xr-x 745 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/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