## process this file with automake to produce Makefile.in

locdir=$(datadir)/locale

all: po-merge de.mo zh_CN.mo


install-data-local:
	cp de.mo $(locdir)/de/LC_MESSAGES/Subcommander.mo
	cp zh_CN.mo $(locdir)/zh_CN/LC_MESSAGES/Subcommander.mo


clean-local:
	test ! -f Subcommander.pot || rm Subcommander.pot
	for i in `ls *.mo` ; do \
    rm $$i; \
  done


pot:
	(cd ..; \
   find \
    subcommander \
    submerge     \
    sublib       \
    svn          \
    util         \
    win32st      \
        -name *.cpp -print   \
    -or -name *.h   -print   \
    -or -name .svn  -prune   \
    -or -name moc   -prune   \
    | \
    xgettext \
      --sort-by-file -d Subcommander \
      --msgid-bugs-address=dev@subcommander.tigris.org \
      --add-comments \
      --qt \
      -k_ -k_q -k_s -k_n \
      --flag=_:1:pass-c-format \
      --files-from=- \
      -o po/Subcommander.pot)



po-merge: pot
	for i in `find . -name "*.po"` ; do \
    msgmerge --verbose --sort-by-file --backup=off --update $$i Subcommander.pot ; \
  done



.po.mo:
	echo "$<"; msgfmt --check --statistics -o $@ $<
