all: @echo 'Usage:' @echo ' make pot create thuban.pot' @echo ' make update-po merge a new thuban.po with the *.po files' @echo ' make mo create the mo files' MO_DIR = ../Resources/Locale PO_DIR = po DOMAIN = thuban LIST_POTFILES = grep -l "_(\"" ../Thuban/*.py ../Thuban/*/*.py pot: xgettext -k_ -o $(DOMAIN).pot `$(LIST_POTFILES)` update-po: for po in *.po; do \ lingua=`basename $$po .po`; \ mv $$lingua.po $$lingua.old.po; \ if msgmerge -o $$lingua.po $$lingua.old.po $(DOMAIN).pot; then\ rm $$lingua.old.po; \ else \ rm -f $$lingua.po; \ mv $$lingua.old.po $$lingua.po; \ fi \ done mo: for po in *.po; do\ lingua=`basename $$po .po`; \ install -d $(MO_DIR)/$$lingua/LC_MESSAGES/ ; \ echo -n $$po": "; \ msgfmt --statistics \ -o $(MO_DIR)/$$lingua/LC_MESSAGES/$(DOMAIN).mo $$po ;\ done