1
0
Fork 0

Use a helper msgfmt-desktop script instead of invoking msgfmt(1) directly

This commit is contained in:
John Zaitseff 2017-05-17 20:49:03 +10:00
parent a6b88fe12f
commit a1c15b0973
4 changed files with 37 additions and 11 deletions

19
.gitattributes vendored
View File

@ -1,9 +1,10 @@
Makefile.am ident
/configure.ac ident
/build-aux/bootstrap ident
/doc/trader.* ident
/po/LINGUAS ident
/po/Makevars ident
/po/POTFILES.in ident
/src/*.c ident
/src/*.h ident
Makefile.am ident
/configure.ac ident
/build-aux/bootstrap ident
/build-aux/msgfmt-desktop ident
/doc/trader.* ident
/po/LINGUAS ident
/po/Makevars ident
/po/POTFILES.in ident
/src/*.c ident
/src/*.h ident

View File

@ -31,4 +31,6 @@
SUBDIRS = lib src po data doc m4
# Additional files to distribute
EXTRA_DIST = build-aux/bootstrap
EXTRA_DIST = \
build-aux/bootstrap \
build-aux/msgfmt-desktop

23
build-aux/msgfmt-desktop Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
# Create or update desktop files using msgfmt(1)
# $Id$
# Usage:
# msgfmt-desktop -d PODIR INPUT OUTPUT
set -e
if [ x"$1" != x"-d" ]; then
echo "$0: Missing parameters" 1>&2
exit 1
fi
PODIR="$2"
INPUT="$3"
OUTPUT="$4"
if ! msgfmt --desktop -d "$PODIR" --template "$INPUT" -o "$OUTPUT"; then
echo "$0: Using cp(1) program instead"
cp "$INPUT" "$OUTPUT"
fi

View File

@ -35,4 +35,4 @@ EXTRA_DIST = \
trader.desktop: trader.desktop.in
msgfmt --desktop -d $(top_srcdir)/po --template $< -o $@
$(top_srcdir)/build-aux/msgfmt-desktop -d $(top_srcdir)/po $< $@