summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2006-08-05 03:50:51 +0000
committerPaul W. Frields <stickster@gmail.com>2006-08-05 03:50:51 +0000
commit141362ebcca9814b0934ef90c01e3ea1bb8ede80 (patch)
treec5878719d70519bfd8abe3b1f3c7617479f46867
parent9ba41f4a0d49d466db3d4d051bccfe4e3e78e3a1 (diff)
downloadfedora-doc-utils-141362ebcca9814b0934ef90c01e3ea1bb8ede80.tar.gz
fedora-doc-utils-141362ebcca9814b0934ef90c01e3ea1bb8ede80.tar.xz
fedora-doc-utils-141362ebcca9814b0934ef90c01e3ea1bb8ede80.zip
This change temporarily breaks building but will improve translation
overall. The rpm-info.xml should no longer contain any translations, and should now be stored in the original language directory. It will still be used to generate fdp-info.xml, and we will probably also strip RPM information out of the DTD since we intend to use a standard specfile for this purpose from here on out.
-rw-r--r--Makefile.common32
-rw-r--r--packaging/bookinfo.xsl24
2 files changed, 32 insertions, 24 deletions
diff --git a/Makefile.common b/Makefile.common
index b44c8f8..a95e6df 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -102,7 +102,7 @@ ifeq "${PRI_LANG}" ""
PRI_LANG= en
endif
ifeq "${RPMINFO}" ""
-RPMINFO = ${PWD}/rpm-info.xml
+RPMINFO = rpm-info.xml
endif
ifeq "${RPMPREP}" ""
RPMPREP=yes
@@ -684,12 +684,38 @@ help::
#########################################################################
#########################################################################
+# The "${LANG}/rpm-info.xml" file contains the revision information for
+# the original DocBook source. We use it to generate the "fdp-info.xml"
+# file discussed in the next section.
+#
+define rpm-info_template
+${1}/${RPMINFO}:: po/${1}.po ${PRI_LANG}/${RPMINFO}
+ mkdir -p ${1}
+ ${XML2PO} ${XML2POFLAGS} -p po/${1}.po \
+ ${PRI_LANG}/${RPMINFO} >$$@
+
+clean::
+ ${RM} ${1}/${RPMINFO}
+
+help::
+ @printf ${TFMT} '${1}/${RPMINFO}' 'Make translated document revision info'
+endef
+
+# ${PRI_LANG}/${RPMINFO} must exist, only generate for OTHERS
+$(foreach L,${OTHERS},$(eval $(call rpm-info_template,${L})))
+# Make sure rpm-info is part of the document PO template
+$(foreach L,${LANGUAGES},$(eval XMLFILES-${L}+=${L}/${RPMINFO}))
+#
+#########################################################################
+
+
+#########################################################################
# The "${LANG}/fdp-info.xml" file contains the <articleinfo> or
# <bookinfo> stanza. It is automatically generated from data in the
# "rpm-info.xml" file whenever that file changes.
#
define fdp-info_template
-$(1)/fdp-info.xml:: $(RPMINFO)
+$(1)/fdp-info.xml:: ${1}/$(RPMINFO)
mkdir -p ${1}
LANG=$(1).UTF-8 ${XSLTPROC} --stringparam lang $(1) \
--stringparam fdpdir $(FDPDIR) \
@@ -697,7 +723,7 @@ $(1)/fdp-info.xml:: $(RPMINFO)
doctype ${PRI_LANG}/$(DOCBASE).xml) \
--stringparam legalbase ${LEGALNOTICEBASE} \
${FDPDIR}/docs-common/packaging/bookinfo.xsl \
- $(RPMINFO) | \
+ ${1}/$(RPMINFO) | \
$(XMLFORMAT) $(XMLFOPTS) >$$@
clean::
diff --git a/packaging/bookinfo.xsl b/packaging/bookinfo.xsl
index 884129a..7cbe15f 100644
--- a/packaging/bookinfo.xsl
+++ b/packaging/bookinfo.xsl
@@ -59,27 +59,9 @@
<xsl:call-template name="initials"><xsl:with-param name="who" select="author/@worker"/></xsl:call-template>
</xsl:element>
<xsl:element name="revdescription">
- <xsl:choose>
- <xsl:when test="details[@lang = $lang]">
- <xsl:for-each select="details[@lang = $lang]">
- <xsl:element name="para">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="details[@lang = 'en_US']">
- <xsl:for-each select="details[@lang = 'en_US']">
- <xsl:element name="para">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="para">
- <xsl:text>(...)</xsl:text>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:element name="para">
+ <xsl:value-of select="details"/>
+ </xsl:element>
</xsl:element>
</xsl:element>
</xsl:for-each>