diff options
Diffstat (limited to 'po/POTgen.sh')
-rwxr-xr-x | po/POTgen.sh | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/po/POTgen.sh b/po/POTgen.sh index 15fc85677..12890f41f 100755 --- a/po/POTgen.sh +++ b/po/POTgen.sh @@ -1,4 +1,25 @@ #!/bin/bash +# This program is run by a CI job -cd .. -grep "_(" -Irl src | sort >po/POTFILES.in +if [[ ! -d po || ! -d src ]]; then + printf "Please run this in top level directory" + exit 1 +fi + +printf "# Generated by %s, do not edit manually\n" "$0" > po/POTFILES.in + +#printf "Environment LANG is '%s'\n" "$(env | grep '^LANG=')" +#printf "Environment LC_COLLATE is '%s'\n" "$(env | grep '^LC_COLLATE=')" +#if command -v locale >/dev/null; then +# printf "locale LC_COLLATE is '%s'\n" "$(locale | grep '^LC_COLLATE=')" +#fi + +# See WARNING in manpage of GNU Coreutils sort: +# LC_COLLATE override is required to preserve the order of files +# across platforms. But it can be overriden by LC_ALL. +# But, LC_ALL should never be set in a sane environment. +grep "[^_]_(" src \ + --binary-files=without-match \ + --files-with-matches \ + --recursive \ + | LC_COLLATE="C" sort >> po/POTFILES.in |