blob: 7ed9499593ba4a54954a4aa7a4b2891eb18a884e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
POTFILE := $(srcdir)/po/scummvm.pot
POFILES := $(wildcard $(srcdir)/po/*.po)
updatepot:
xgettext -f $(srcdir)/po/POTFILES -D $(srcdir) -d scummvm --c++ -k_ -k_t -k_s -o $(POTFILE) \
"--copyright-holder=ScummVM Team" --package-name=ScummVM \
--package-version=$(VERSION) --msgid-bugs-address=scummvm-devel@lists.sf.net -o $(POTFILE)_
sed -e 's/SOME DESCRIPTIVE TITLE/LANGUAGE translation for ScummVM/' \
-e 's/UTF-8/CHARSET/' -e 's/PACKAGE/ScummVM/' $(POTFILE)_ > $(POTFILE).new
rm $(POTFILE)_
if test -f $(POTFILE); then \
sed -f $(srcdir)/po/remove-potcdate.sed < $(POTFILE) > $(POTFILE).1 && \
sed -f $(srcdir)/po/remove-potcdate.sed < $(POTFILE).new > $(POTFILE).2 && \
if cmp $(POTFILE).1 $(POTFILE).2 >/dev/null 2>&1; then \
rm -f $(POTFILE).new; \
else \
rm -f $(POTFILE) && \
mv -f $(POTFILE).new $(POTFILE); \
fi; \
rm -f $(POTFILE).1 $(POTFILE).2; \
else \
mv -f $(POTFILE).new $(POTFILE); \
fi;
%.po: $(POTFILE)
msgmerge $@ $(POTFILE) -o $@.new
if cmp $@ $@.new >/dev/null 2>&1; then \
rm -f $@.new; \
else \
mv -f $@.new $@; \
fi;
#$(srcdir)/common/messages.cpp: $(POFILES)
# perl $(srcdir)/tools/po2c $^ > $(srcdir)/common/messages.cpp
update-translations: updatepot $(POFILES)
@$(foreach file, $(POFILES), echo -n $(notdir $(basename $(file)))": ";msgfmt --statistic $(file);)
@rm -f messages.mo
perl $(srcdir)/tools/po2c $(POFILES) > $(srcdir)/common/messages.cpp
.PHONY: updatepot update-translations
|