2010-06-17 19:07:45 +00:00
|
|
|
POTFILE := $(srcdir)/po/scummvm.pot
|
|
|
|
POFILES := $(wildcard $(srcdir)/po/*.po)
|
2010-06-15 10:44:51 +00:00
|
|
|
|
2016-01-25 19:36:05 +00:00
|
|
|
ENGINE_INPUT_POTFILES := $(sort $(wildcard $(srcdir)/engines/*/POTFILES))
|
2010-06-15 10:44:51 +00:00
|
|
|
updatepot:
|
2013-08-12 15:35:41 +00:00
|
|
|
cat $(srcdir)/po/POTFILES $(ENGINE_INPUT_POTFILES) | \
|
|
|
|
xgettext -f - -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 \
|
2016-10-04 11:55:28 +00:00
|
|
|
--package-version=$(VERSION) --msgid-bugs-address=scummvm-devel@lists.scummvm.org -o $(POTFILE)_
|
2010-06-15 10:44:51 +00:00
|
|
|
|
|
|
|
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
|
2020-12-09 23:06:33 +00:00
|
|
|
devtools/create_translations/create_translations translations.dat $(POFILES)
|
2010-09-08 17:05:55 +00:00
|
|
|
mv translations.dat $(srcdir)/gui/themes/
|
2010-10-12 02:18:11 +00:00
|
|
|
|
2020-07-03 21:43:05 +00:00
|
|
|
update-translations: updatepot $(POFILES) translations-dat
|
2010-08-19 11:46:55 +00:00
|
|
|
|
2020-07-03 21:43:05 +00:00
|
|
|
update-translations: updatepot $(POFILES)
|
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
|