1 include $(top_srcdir)/po/Makevars
26 LOCALPOFILES = po/cs.po po/en_GB.po
28 POTFILE=po/$(DOMAIN).pot
30 TRANSLATABLE_FILES = $(DIST_SOURCES) $(all_q_sources)
33 --copyright-holder="$(COPYRIGHT_HOLDER)" \
34 --package-name=$(PACKAGE) \
35 --package-version=$(VERSION) \
36 --msgid-bugs-address=$(MSGID_BUGS_ADDRESS) \
38 --add-comments='TRANSLATORS:'
40 $(POTFILE): $(TRANSLATABLE_FILES) $(UI_FILES) src/ui/gui/gen-dot-desktop.sh
42 $(AM_V_GEN)$(XGETTEXT) --directory=$(top_srcdir) $(XGETTEXT_OPTIONS) $(TRANSLATABLE_FILES) --language=C --keyword=_ --keyword=N_ -o $@,tmp
43 $(AM_V_at)$(XGETTEXT) --directory=$(top_srcdir) $(XGETTEXT_OPTIONS) -j $(UI_FILES) --language=glade -o $@,tmp
44 $(AM_V_at)$(XGETTEXT) --directory=$(top_srcdir) $(XGETTEXT_OPTIONS) -j src/ui/gui/gen-dot-desktop.sh --language=shell --keyword=TRANSLATE -o $@,tmp
45 $(AM_V_at)$(SED) -e '/^"POT-Creation-Date: .*/d' $@,tmp > $@
47 $(LOCALPOFILED) $(POFILES): $(POTFILE)
48 $(AM_V_GEN)$(MSGMERGE) --quiet $(top_srcdir)/$@ $? -o $@,tmp
49 $(AM_V_at)if test -e $(top_srcdir)/$@,aux ; then \
51 msgcat --use-first $(top_srcdir)/$@,aux $@,tmp -o $@,tmp; \
53 $(AM_V_at)$(SED) -e '/^"POT-Creation-Date: /d' $@,tmp > $@,tmp2
59 @$(MKDIR_P) `dirname $@`
60 $(AM_V_GEN)$(MSGFMT) $< -o $@
63 GMOFILES = $(LOCALPOFILES:.po=.gmo) $(POFILES:.po=.gmo)
65 ALL_LOCAL += $(GMOFILES)
67 install-data-hook: $(GMOFILES)
68 for f in $(GMOFILES); do \
69 lang=`echo $$f | $(SED) -e 's%po/\(.*\)\.gmo%\1%' ` ; \
70 $(MKDIR_P) $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES; \
71 $(INSTALL_DATA) $$f $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo ; \
75 for f in $(GMOFILES); do \
76 lang=`echo $$f | $(SED) -e 's%po/\(.*\)\.gmo%\1%' ` ; \
77 rm -f $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo ; \
88 CLEANFILES += $(GMOFILES) $(POTFILE)
90 # Clean $(POFILES) from build directory but not if that's the same as
91 # the source directory.
93 @if test "$(srcdir)" != .; then \
94 echo rm -f $(LOCALPOFILES) $(POFILES); \
95 rm -f $(LOCALPOFILES) $(POFILES); \
97 CLEAN_LOCAL += po_CLEAN
101 cd $(srcdir) && rm -f $(POFILES)
103 for po in `echo '$(POFILES)' | sed 's,po/,,g'`; do \
104 $(WGET) https://translationproject.org/latest/pspp/$$po; \