scummvm/po/module.mk
Thierry Crozat bc821136fd i18n: Add support for context in translations.
This change means there can now be different translations for the same
english string depending on the context. It is based on gettext msgctxt feature.
There is a new macro _c(msg, ctxt) that should be used instead of _(msg) in
the source code when we want to add a context to the message. For the
moment I have added contexts to only one message ("None") so that I could
test the changes. Context could be added also to get shorter translations when
GUI is in 1x mode.

I have also added back the fuzzy option to msmerge since it is useful when
adding contexts to populate the translations for the new contexts.

svn-id: r52308
2010-08-23 19:45:14 +00:00

49 lines
1.6 KiB
Makefile

POTFILE := $(srcdir)/po/scummvm.pot
POFILES := $(wildcard $(srcdir)/po/*.po)
updatepot:
xgettext -f $(srcdir)/po/POTFILES -D $(srcdir) -d scummvm --c++ -k_ -k_s -k_c:1,2c -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
translations-dat: tools/create_translations
tools/create_translations/create_translations $(POFILES)
mv translations.dat gui/themes/
update-translations: updatepot $(POFILES) translations-dat
update-translations: updatepot $(POFILES)
@$(foreach file, $(POFILES), echo -n $(notdir $(basename $(file)))": ";msgfmt --statistic $(file);)
@rm -f messages.mo
.PHONY: updatepot translations-dat update-translations