summaryrefslogtreecommitdiff
path: root/po-doc/Makefile.am
blob: 3af8e5f84b092e0c342efed276a8ba74d9f54eb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
## Makefile.am file for the XML documents translation.
##
## Copyright (C) 2006 The Xfce development team.
##
## Written by Daichi Kawahata <daichi@xfce.org>, 2006.
##
## This file is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
##
## This file is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA.

##
## Rules to auto-generate translated XML files
##
## At first, you need to install `xml2po' package maintained by
## GNOME team, too bad it's not a separated package (and depends
## libxml2 >= 2.5.11), to get a workable package, try the following
## steps:
##
##    cvs -d:pserver:anonymous@anoncvs.gnome.org:/cvs/gnome login
##    (RETURN)
##    cvs -d:pserver:anonymous@anoncvs.gnome.org:/cvs/gnome co \
##      gnome-doc-utils/xml2po
##    cd gnome-doc-utils/xml2po && ./autogen.sh && make
##
## For developers: Nothing, you need nothing to do basically,
##   however it's appreciated if you'll install the package above,
##   keep updating POT, PO files when you'll update your documents.
##
## For translators: Just translate your PO file with your favorite
##   editor, if you see no PO file for your language, then type
##   `msginit' in this directory and enter your contact address.
##
## For maintainers: You're supposed to watch every changes made
##   by the developers, translators; if POT, PO files are out-of-
##   dated or generated XML files are committed properly.
##
## A problem could be the matter is, it takes a time to update
## entire files due to its size and processing method in general
## (comparing with the gettext PO files), also with the same
## reason, it costs a certain disk spaces against the repository.
##

srcdir = @srcdir@
top_srcdir = @top_srcdir@
docdir = $(top_srcdir)/docs/manual

if ENABLE_XML2PO
all-local: $(PACKAGE).pot

$(PACKAGE).pot: $(docdir)/C/$(PACKAGE).xml.in
	$(XML2PO) -o $(PACKAGE).pot $(docdir)/C/$(PACKAGE).xml.in

update-po: Makefile $(PACKAGE).pot
	@echo "*** Updating PO ***"
	langs=`sed -e '/^#/d' $(srcdir)/LINGUAS`; \
	for lang in $$langs; do \
		$(XML2PO) -u $$lang.po $(docdir)/C/$(PACKAGE).xml.in; \
	done

update-xml: Makefile $(PACKAGE).pot
	@echo "*** Updating XML ***"
	langs=`sed -e '/^#/d' $(srcdir)/LINGUAS`; \
	for lang in $$langs; do \
		if test -n $(docdir)/$$lang; then \
			mkdir -p $(docdir)/$$lang; \
		fi; \
		$(XML2PO) -p $$lang.po $(docdir)/C/$(PACKAGE).xml.in > $(docdir)/$$lang/$(PACKAGE).xml.in; \
	done

else
all-local:
endif

if ENABLE_XML2PO
dist-check-xml2po: all
else
dist-check-xml2po:
	@echo "*** xml2po must be installed and enabled in order to make dist"
	@false
endif

DISTCLEANFILES = $(PACKAGE).pot