1 # PSPP - a program for statistical analysis.
2 # Copyright (C) 2017, 2020 Free Software Foundation, Inc.
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 include $(top_srcdir)/po/Makevars
42 LOCALPOFILES = po/cs.po
44 POTFILE=po/$(DOMAIN).pot
46 TRANSLATABLE_FILES = $(DIST_SOURCES) $(all_q_sources)
49 --copyright-holder="$(COPYRIGHT_HOLDER)" \
50 --package-name=$(PACKAGE) \
51 --package-version=$(VERSION) \
52 --msgid-bugs-address=$(MSGID_BUGS_ADDRESS) \
54 --add-comments='TRANSLATORS:' \
55 --directory=$(top_srcdir)
57 ALL_TRANSLATABLE_FILES = \
58 $(TRANSLATABLE_FILES) \
60 doc/org.fsf.pspp.metainfo.xml.in \
61 doc/org.fsf.pspp.desktop.in
63 $(POTFILE): $(ALL_TRANSLATABLE_FILES) Makefile
65 $(AM_V_GEN)$(XGETTEXT) $(XGETTEXT_OPTIONS) $(TRANSLATABLE_FILES) --language=C --keyword=_ --keyword=N_ -o $@,tmp
66 $(AM_V_at)test -z "$(UI_FILES)" || $(XGETTEXT) $(XGETTEXT_OPTIONS) -j $(UI_FILES) --language=Glade -o $@,tmp
67 $(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j doc/org.fsf.pspp.metainfo.xml.in -o $@,tmp
68 $(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j doc/org.fsf.pspp.desktop.in -o $@,tmp
69 $(AM_V_at)$(SED) -e '/^"POT-Creation-Date: .*/d' $@,tmp > $@
72 $(LOCALPOFILES) $(POFILES): $(POTFILE)
73 $(AM_V_GEN)$(MSGMERGE) --previous --quiet $(top_srcdir)/$@ $? -o $@,tmp
74 $(AM_V_at)if test -e $(top_srcdir)/$@,aux ; then \
76 msgcat --use-first $(top_srcdir)/$@,aux $@,tmp -o $@,tmp; \
78 $(AM_V_at)$(SED) -e '/^"POT-Creation-Date: /d' $@,tmp > $@,tmp2
80 $(MSGFMT) -c $@,tmp2 -o - > /dev/null
85 @$(MKDIR_P) `dirname $@`
86 $(AM_V_GEN)$(MSGFMT) $< -o $@
89 GMOFILES = $(LOCALPOFILES:.po=.gmo) $(POFILES:.po=.gmo)
91 ALL_LOCAL += $(GMOFILES)
93 install-data-hook: $(GMOFILES)
94 for f in $(GMOFILES); do \
95 lang=`echo $$f | $(SED) -e 's%po/\(.*\)\.gmo%\1%' ` ; \
96 $(MKDIR_P) $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES; \
97 $(INSTALL_DATA) $$f $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo ; \
101 for f in $(GMOFILES); do \
102 lang=`echo $$f | $(SED) -e 's%po/\(.*\)\.gmo%\1%' ` ; \
103 rm -f $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo ; \
115 CLEANFILES += $(GMOFILES) $(POTFILE)
117 # Clean $(POFILES) from build directory but not if that's the same as
118 # the source directory.
120 @if test "$(srcdir)" != .; then \
121 echo rm -f $(LOCALPOFILES) $(POFILES); \
122 rm -f $(LOCALPOFILES) $(POFILES); \
124 CLEAN_LOCAL += po_CLEAN
126 # Download the po files from http://translationproject.org
127 # The final action to this rule is to remove the .pot file. This
128 # is because the po files must be re-merged against an updated version of it.
130 # You can update just one .po file with, e.g.:
131 # make po-update POFILES=po/uk.po
134 for p in $(POFILES); do \
135 wget --no-use-server-timestamps -O $$p,tmp \
136 https://translationproject.org/latest/pspp/`basename $$p` ; \
137 mv $$p,tmp ${top_srcdir}/$$p; \