8983
|
1 |
|
|
2 |
all:
|
13545
|
3 |
@MSGCAT=$${MSGCAT:-msgcat}; \
|
|
4 |
MSGCAT_VERSION=`$$MSGCAT --version | head -1 | awk '{print $$NF}'`; \
|
|
5 |
MSGCAT_VERSION=`echo $$MSGCAT_VERSION | awk -F. '{ print $$1 * 1000 + $$2 * 100 + $$3; }'`; \
|
|
6 |
if [ $$MSGCAT_VERSION -lt 1500 ] ; then \
|
|
7 |
MSGCAT=/usr/bin/msgcat; \
|
|
8 |
MSGCAT_VERSION=`$$MSGCAT --version | head -1 | awk '{print $$NF}'`; \
|
|
9 |
MSGCAT_VERSION=`echo $$MSGCAT_VERSION | awk -F. '{ print $$1 * 1000 + $$2 * 100 + $$3; }'`; \
|
|
10 |
if [ $$MSGCAT_VERSION -lt 1500 ] ; then \
|
|
11 |
printf "msgcat version 0.15 is required for msgctxt\n"; \
|
|
12 |
printf "rf. http://live.gnome.org/GnomeGoals/MsgctxtMigration\n"; \
|
|
13 |
exit 1; \
|
|
14 |
fi; \
|
|
15 |
fi; \
|
|
16 |
\
|
|
17 |
for po_sun in $(POFILES); do \
|
|
18 |
po=$(PODIR)/$$po_sun; \
|
|
19 |
if test ! -f $$po; then \
|
|
20 |
continue; \
|
|
21 |
fi; \
|
|
22 |
\
|
|
23 |
echo "Merging $$po_sun ..."; \
|
|
24 |
\
|
|
25 |
header_community=$${po_sun}.header; \
|
|
26 |
I=0; \
|
|
27 |
exec < $$po; \
|
|
28 |
while read line; \
|
|
29 |
do \
|
|
30 |
is_comment=`echo $$line | grep '^#' | grep -v '^#,'`; \
|
|
31 |
if [ x"$$is_comment" = x ] ; then \
|
|
32 |
break; \
|
|
33 |
fi; \
|
|
34 |
I=`expr $$I + 1`; \
|
|
35 |
done; \
|
|
36 |
exec <&-; \
|
|
37 |
if [ $$I -ne 0 ] ; then \
|
|
38 |
sed -ne "1,$${I}p" $$po > $$header_community; \
|
|
39 |
fi; \
|
|
40 |
\
|
14842
|
41 |
po_sun_no_obs=$$po_sun.no_obs; \
|
|
42 |
sed -e "/^#~/d" $$po_sun > $$po_sun_no_obs; \
|
|
43 |
\
|
13545
|
44 |
if [ -f $$header_community ] ; then \
|
14842
|
45 |
$$MSGCAT --use-first $$po_sun_no_obs $$po -o $$po.$$; \
|
13545
|
46 |
cat $$header_community $$po.$$ > $$po; \
|
|
47 |
rm $$header_community $$po.$$; \
|
|
48 |
else \
|
14842
|
49 |
$$MSGCAT --use-first $$po_sun_no_obs $$po -o $$po; \
|
13545
|
50 |
fi; \
|
8983
|
51 |
done
|
|
52 |
|
|
53 |
top_builddir = ..
|
|
54 |
PODIR = $(top_builddir)/po
|
|
55 |
POFILES = $(wildcard *.po)
|
|
56 |
|