2020-02-18 13:05:47 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2021-08-08 22:00:43 -04:00
|
|
|
srcdirs="src subprojects/extensions-tool"
|
2022-02-10 12:18:34 -05:00
|
|
|
uidirs="js subprojects/extensions-app"
|
2023-08-19 21:33:52 -04:00
|
|
|
desktopdirs="data subprojects/extensions-app/ subprojects/extensions-tool"
|
2020-02-18 13:05:47 -05:00
|
|
|
|
|
|
|
# find source files that contain gettext keywords
|
2021-08-08 22:00:43 -04:00
|
|
|
files=$(grep -lR --include='*.c' '\(gettext\|[^I_)]_\)(' $srcdirs)
|
2020-02-18 13:05:47 -05:00
|
|
|
|
2022-02-10 12:18:34 -05:00
|
|
|
# find ui files that contain translatable string
|
|
|
|
files="$files "$(grep -lRi --include='*.ui' 'translatable="[ty1]' $uidirs)
|
|
|
|
|
2023-08-19 21:33:52 -04:00
|
|
|
# find .desktop files
|
|
|
|
files="$files "$(find $desktopdirs -name '*.desktop*')
|
|
|
|
|
2020-03-09 20:39:09 -04:00
|
|
|
# filter out excluded files
|
|
|
|
if [ -f po/POTFILES.skip ]; then
|
|
|
|
files=$(for f in $files; do ! grep -q ^$f po/POTFILES.skip && echo $f; done)
|
|
|
|
fi
|
|
|
|
|
2020-02-18 13:05:47 -05:00
|
|
|
# find those that aren't listed in POTFILES.in
|
|
|
|
missing=$(for f in $files; do ! grep -q ^$f po/POTFILES.in && echo $f; done)
|
|
|
|
|
|
|
|
if [ ${#missing} -eq 0 ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat >&2 <<EOT
|
|
|
|
|
|
|
|
The following files are missing from po/POTFILES.po:
|
|
|
|
|
|
|
|
EOT
|
|
|
|
for f in $missing; do
|
|
|
|
echo " $f" >&2
|
|
|
|
done
|
|
|
|
echo >&2
|
|
|
|
|
|
|
|
exit 1
|