2021-10-22 22:23:59 +02:00
|
|
|
#!/bin/sh -e
|
|
|
|
# This shell script generates the translation template.
|
|
|
|
#
|
|
|
|
# The reason for this not being inside CMakeLists.txt is that the translator
|
|
|
|
# should not need to run the whole configuration process just to get this file.
|
|
|
|
dir=$(dirname $0)
|
2010-09-13 19:24:53 +02:00
|
|
|
|
2021-10-22 22:23:59 +02:00
|
|
|
export LC_ALL=C
|
2011-01-10 16:49:13 +01:00
|
|
|
|
2021-10-22 22:23:59 +02:00
|
|
|
re='^[ \t]*project *( *\([^ \t)]\{1,\}\) \{1,\}VERSION \{1,\}\([^ \t)]\{1,\}\).*'
|
|
|
|
package=$(sed -n "s/$re/\\1/p" "$dir/../CMakeLists.txt")
|
|
|
|
version=$(sed -n "s/$re/\\2/p" "$dir/../CMakeLists.txt")
|
|
|
|
if [ -z "$package" -o -z "$version" ]; then
|
|
|
|
echo "Failed to get information from CMakeLists.txt"
|
|
|
|
exit 1
|
2010-09-13 19:24:53 +02:00
|
|
|
fi
|
|
|
|
|
2021-10-22 22:23:59 +02:00
|
|
|
xgettext -LC -k_ -kN_ "$dir"/../{src,liblogdiag}/*.c -o "$dir/$package.pot" \
|
|
|
|
--package-name="$package" --package-version="$version" \
|
|
|
|
--copyright-holder="Přemysl Eric Janouch" \
|
|
|
|
--msgid-bugs-address="https://git.janouch.name/p/$package/issues"
|