From ff480e0d573422fa2d0a7d3ffc59f3c6b5b79852 Mon Sep 17 00:00:00 2001 From: Tommy Reynolds Date: Fri, 3 Feb 2006 15:52:52 +0000 Subject: Added "make po" target to generate PO files for all the "en" XML files for the project. File "foo-en.xml" will be associated with a "foo-en.po" file, which may be edited and then merged into a new translation using the fdpsh "apply_po foo-en.xml>foo-xx.xml" command. --- Makefile.common | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Makefile.common b/Makefile.common index d4d4eea..f145690 100644 --- a/Makefile.common +++ b/Makefile.common @@ -65,6 +65,13 @@ XMLTO =xmlto XSLTPROC=xsltproc XMLFORMAT=xmlformat XMLFOPTS=-f $(FDPDIR)/docs-common/bin/xmlformat-fdp.conf +XML2PO =xml2po +######################################################################### +# Rules to produce .po files from .xml files. Get the tools to do this +# from the gnome-doc-utils RPM. +.SUFFIXES: .po .xml +%.po: %.xml + ${XML2PO} $< >$@ ######################################################################### # Use our very own "docs-common/bin/fdpsh" as the command interpreter # This automatically has ${FDPBIN} as first in the ${PATH} @@ -91,10 +98,16 @@ RPMJUNK = \ --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ FIXME ######################################################################### +# Set a provisional ${LANG} value. We'll dynamically change this as +# needed. The "en" value is used because that is the original language +# of most of our current documentation. +LANG =en +######################################################################### # PUT NO TARGETS BEFORE THIS ONE, not even in your base Makefile # In a properly-constructed Makefile, this will be the default target -TARGETS=all tarball pdf html html-nochunks clean distclean showvars fdp-info +TARGETS=all clean distclean fdp-info html html-nochunks pdf po showvars \ + tarball .PHONY: ${TARGETS} .PHONY: $(foreach LANG,${LANGUAGES},html-${LANG}) .PHONY: $(foreach LANG,${LANGUAGES},html-nochunks-${LANG}) @@ -204,6 +217,11 @@ $(foreach LANG,${LANGUAGES},$(eval $(call DISTCLEAN_template,${LANG}))) # distclean:: $(foreach LANG,${LANGUAGES},${DOCBASE}-${LANG}-distclean) ######################################################################### +# Target "po" produces ".po" files from the manifested XML files for +# the current language. +POFILES =${DOCBASE}-${LANG}.po ${XMLEXTRAFILES-${LANG}:.xml=.po} +po:: ${POFILES} +######################################################################### # showvars:: @echo "DOCBASE=\"$(DOCBASE)\"" @@ -276,6 +294,7 @@ distclean:: ${RM} *.desktop ${RM} *.spec ${RM} *.src.tar.gz + ${RM} *.po spec:: ${SPECFILE} -- cgit