2010-06-17 19:07:45 +00:00
|
|
|
POTFILE := $(srcdir)/po/scummvm.pot
|
|
|
|
POFILES := $(wildcard $(srcdir)/po/*.po)
|
2012-01-09 02:33:59 +00:00
|
|
|
CPFILES := $(wildcard $(srcdir)/po/*.cp)
|
2010-06-15 10:44:51 +00:00
|
|
|
|
|
|
|
updatepot:
|
2011-08-20 13:15:01 +00:00
|
|
|
xgettext -f $(srcdir)/po/POTFILES -D $(srcdir) -d scummvm --c++ -k_ -k_s -k_c:1,2c -k_sc:1,2c --add-comments=I18N\
|
2010-08-30 22:27:51 +00:00
|
|
|
-kDECLARE_TRANSLATION_ADDITIONAL_CONTEXT:1,2c -o $(POTFILE) \
|
|
|
|
--copyright-holder="ScummVM Team" --package-name=ScummVM \
|
2010-06-15 10:44:51 +00:00
|
|
|
--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 \
|
2010-06-17 19:07:45 +00:00
|
|
|
sed -f $(srcdir)/po/remove-potcdate.sed < $(POTFILE) > $(POTFILE).1 && \
|
|
|
|
sed -f $(srcdir)/po/remove-potcdate.sed < $(POTFILE).new > $(POTFILE).2 && \
|
2010-06-15 10:44:51 +00:00
|
|
|
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;
|
|
|
|
|
2010-06-17 19:14:40 +00:00
|
|
|
%.po: $(POTFILE)
|
2010-08-23 19:45:14 +00:00
|
|
|
msgmerge $@ $(POTFILE) -o $@.new
|
2010-06-15 10:44:51 +00:00
|
|
|
if cmp $@ $@.new >/dev/null 2>&1; then \
|
|
|
|
rm -f $@.new; \
|
|
|
|
else \
|
|
|
|
mv -f $@.new $@; \
|
|
|
|
fi;
|
|
|
|
|
2011-04-09 21:47:35 +00:00
|
|
|
translations-dat: devtools/create_translations
|
2012-01-09 02:33:59 +00:00
|
|
|
devtools/create_translations/create_translations $(POFILES) $(CPFILES)
|
2010-09-08 17:05:55 +00:00
|
|
|
mv translations.dat $(srcdir)/gui/themes/
|
2010-10-12 02:18:11 +00:00
|
|
|
|
2012-01-09 02:33:59 +00:00
|
|
|
update-translations: updatepot $(POFILES) $(CPFILES) translations-dat
|
2010-08-19 11:46:55 +00:00
|
|
|
|
2012-01-09 02:33:59 +00:00
|
|
|
update-translations: updatepot $(POFILES) $(CPFILES)
|
2010-06-15 10:44:51 +00:00
|
|
|
@$(foreach file, $(POFILES), echo -n $(notdir $(basename $(file)))": ";msgfmt --statistic $(file);)
|
|
|
|
@rm -f messages.mo
|
|
|
|
|
2010-08-19 11:46:55 +00:00
|
|
|
.PHONY: updatepot translations-dat update-translations
|