summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2006-02-28 02:06:49 +0000
committerTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2006-02-28 02:06:49 +0000
commit66771e17f1c6ec9a86703622157d37a4b512ee19 (patch)
treeee10bda0eb22ab2bedc1a645f1d55b06951fced3
parent5ba0ead194412c37d8f32580c82b934d1ae3a636 (diff)
downloadfedora-doc-utils-66771e17f1c6ec9a86703622157d37a4b512ee19.tar.gz
fedora-doc-utils-66771e17f1c6ec9a86703622157d37a4b512ee19.tar.xz
fedora-doc-utils-66771e17f1c6ec9a86703622157d37a4b512ee19.zip
Added "fdpcommon" kind of entity. Automatically relocate files
marked as "fdpcommon" when building the ".ent" files. Revert Karsten's "Makefile.common" change as a courtesey.
-rw-r--r--Makefile.common2
-rw-r--r--common/entities/Makefile8
-rw-r--r--common/entities/README.txt31
-rw-r--r--common/entities/entities-en.xml16
-rw-r--r--common/entities/entities.dtd2
-rw-r--r--common/entities/entities.xsl38
6 files changed, 84 insertions, 13 deletions
diff --git a/Makefile.common b/Makefile.common
index d98c05e..810460e 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -756,7 +756,7 @@ LOCALE_ENTITIES='locale-entities.xml'
define LOCALE_template
.PHONY: set-locale-${1}
set-locale-${1}::
- ${LN} -f -s ${FDPDIR}/docs-common/common/entities/entities-${1}.xml \
+ ${LN} -f -s ${FDPDIR}/docs-common/common/entities/entities-${1}.ent \
${LOCALE_ENTITIES}
clean::
diff --git a/common/entities/Makefile b/common/entities/Makefile
index 86fcda6..f95461e 100644
--- a/common/entities/Makefile
+++ b/common/entities/Makefile
@@ -23,7 +23,8 @@ ENTFILES=$(foreach L,${PRI_LANG} ${OTHERS},entities-${L}.ent)
# entities file
#
%.ent: %.xml
- xsltproc -o $@ entities.xsl $<
+ xsltproc -o $@ --stringparam FDPCOMMONDIR "${FDPCOMMONDIR}" \
+ entities.xsl $<
#
#######################################################################
@@ -34,6 +35,10 @@ HELPFMT ="%-23s\t| %s.\n"
#######################################################################
#######################################################################
+FDPCOMMONDIR:=$(shell cd .. && /bin/pwd)
+#######################################################################
+
+#######################################################################
# WARNING: put no targets before this one!
#
.PHONY: all
@@ -134,6 +139,7 @@ showvars::
@echo "OTHERXMLFILES=${OTHERXMLFILES}"
@echo "ENTFILES=${ENTFILES}"
@echo "POFILES=${POFILES}"
+ @echo "FDPCOMMONDIR=${FDPCOMMONDIR}"
help::
@printf ${HELPFMT} "make showvars" "Show certain macro values"
#
diff --git a/common/entities/README.txt b/common/entities/README.txt
new file mode 100644
index 0000000..454f11b
--- /dev/null
+++ b/common/entities/README.txt
@@ -0,0 +1,31 @@
+ How To Add Support For A New Locale
+
+ 1) Append the ISO locale code, as either xx or xx_YY, to the
+ ${OTHER} macro definition in the file "Makefile". Below,
+ we will refer to the new locale as ${LANG}.
+
+ 2) Create a .PO file for the locale by typing the command:
+
+ $ make ${LANG}.po
+
+ 3) Add the translations using your favorite .PO file editor,
+ such as kbable(1) or gtranslator(1).
+
+ 4) Review your updated XML file using the command:
+
+ $ make xml-${LANG}
+
+ and reviewing the file "entities-${LANG}.xml" for
+ correctness.
+
+ 5) Repeat steps #3 and #4 until a correct XML file is
+ produced.
+
+ 6) Produce the final output file, "entities-${LANG}.ent" by
+ using the command:
+
+ $ make
+
+ and reviewing the results.
+
+Tommy Reynolds
diff --git a/common/entities/entities-en.xml b/common/entities/entities-en.xml
index 757bc8a..605035c 100644
--- a/common/entities/entities-en.xml
+++ b/common/entities/entities-en.xml
@@ -50,7 +50,7 @@
<comment>cf. Fedora Core</comment>
<text><use entity="FED"/> <use entity="EX"/></text>
</entity>
- <entity name="FP-URL">
+ <entity name="FDP-URL">
<comment>Fedora Docs Project URL</comment>
<text><ulink url="http://fedora.redhat.com/projects/docs/"/></text>
</entity>
@@ -114,31 +114,31 @@
</entity>
</group>
<group name="Common doc files">
- <entity name="LEGALNOTICE" kind="system">
+ <entity name="LEGALNOTICE" kind="fdpcommon">
<comment/>
<text>legalnotice-en.xml</text>
</entity>
- <entity name="LEGALNOTICE-CONTENT" kind="system">
+ <entity name="LEGALNOTICE-CONTENT" kind="fdpcommon">
<comment/>
<text>legalnotice-content-en.xml</text>
</entity>
- <entity name="LEGALNOTICE-OPL" kind="system">
+ <entity name="LEGALNOTICE-OPL" kind="fdpcommon">
<comment/>
<text>legalnotice-opl-en.xml</text>
</entity>
- <entity name="LEGALNOTICE-OPL-CONTENT" kind="system">
+ <entity name="LEGALNOTICE-OPL-CONTENT" kind="fdpcommon">
<comment/>
<text>opl.xml</text>
</entity>
- <entity name="LEGALNOTICE-RELNOTES" kind="system">
+ <entity name="LEGALNOTICE-RELNOTES" kind="fdpcommon">
<comment/>
<text>legalnotice-relnotes-en.xml</text>
</entity>
- <entity name="LEGALNOTICE-SECTION" kind="system">
+ <entity name="LEGALNOTICE-SECTION" kind="fdpcommon">
<comment/>
<text>legalnotice-section-en.xml</text>
</entity>
- <entity name="BUG-REPORTING" kind="system">
+ <entity name="BUG-REPORTING" kind="fdpcommon">
<comment/>
<text>bugreporting-en.xml</text>
</entity>
diff --git a/common/entities/entities.dtd b/common/entities/entities.dtd
index 3726c10..876662a 100644
--- a/common/entities/entities.dtd
+++ b/common/entities/entities.dtd
@@ -4,7 +4,7 @@
<!ELEMENT entity (comment,text) >
<!ATTLIST entity name NMTOKEN #REQUIRED >
-<!ATTLIST entity kind (term|system) "term" >
+<!ATTLIST entity kind (term|system|fdpcommon) "term" >
<!ELEMENT comment (#PCDATA) >
<!ELEMENT text (#PCDATA|use|ulink)* >
diff --git a/common/entities/entities.xsl b/common/entities/entities.xsl
index b28dbac..0646ca1 100644
--- a/common/entities/entities.xsl
+++ b/common/entities/entities.xsl
@@ -3,7 +3,16 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" omit-xml-declaration="yes"/>
+ <xsl:param name="FDPCOMMONDIR">/usr/share/fedora/doc/docs-common/common</xsl:param>
+
<xsl:template match="/">
+ <xsl:comment><xsl:value-of select="' Group: Automatic Entities '"/></xsl:comment>
+ <xsl:call-template name="do_entity">
+ <xsl:with-param name="name">FDPCOMMONDIR</xsl:with-param>
+ <xsl:with-param name="desc">Base directory</xsl:with-param>
+ <xsl:with-param name="extra" />
+ <xsl:with-param name="body" select="$FDPCOMMONDIR"/>
+ </xsl:call-template>
<xsl:apply-templates/>
</xsl:template>
@@ -16,7 +25,7 @@
<xsl:variable name="desc">
<xsl:choose>
<xsl:when test="comment = ''">
- WHO AM I? WHAT AM I? I CAN'T REMEMBER!
+ FIXME: PLEASE DEFINE ME
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="comment"/>
@@ -28,6 +37,9 @@
<xsl:when test="@kind = 'system'">
<xsl:text> SYSTEM</xsl:text>
</xsl:when>
+ <xsl:when test="@kind = 'fdpcommon'">
+ <xsl:text> SYSTEM</xsl:text>
+ </xsl:when>
<xsl:otherwise>
<xsl:text></xsl:text>
</xsl:otherwise>
@@ -36,7 +48,21 @@
<xsl:variable name="body">
<xsl:apply-templates/>
</xsl:variable>
- <xsl:value-of select="concat( '&lt;!ENTITY ', @name, ' ', normalize-space($extra), ' &quot;', normalize-space($body), '&quot; &gt; &lt;!-- ', normalize-space($desc), ' --&gt;')" disable-output-escaping="yes"/>
+ <xsl:call-template name="do_entity">
+ <xsl:with-param name="name" select="@name"/>
+ <xsl:with-param name="desc" select="$desc"/>
+ <xsl:with-param name="extra" select="$extra"/>
+ <xsl:with-param name="body">
+ <xsl:choose>
+ <xsl:when test="@kind = 'fdpcommon'">
+ <xsl:value-of select="concat( $FDPCOMMONDIR, '/', normalize-space($body))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="normalize-space($body)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
</xsl:template>
<xsl:template match="use">
@@ -67,4 +93,12 @@
<xsl:text disable-output-escaping="yes">&apos;/&gt;</xsl:text>
</xsl:template>
+ <xsl:template name="do_entity">
+ <xsl:param name="name">NAME</xsl:param>
+ <xsl:param name="desc">DESC</xsl:param>
+ <xsl:param name="extra"></xsl:param>
+ <xsl:param name="body">BODY</xsl:param>
+ <xsl:value-of select="concat( '&lt;!ENTITY ', $name, ' ', normalize-space($extra), ' &quot;', normalize-space($body), '&quot; &gt; &lt;!-- ', normalize-space($desc), ' --&gt;')" disable-output-escaping="yes"/>
+ </xsl:template>
+
</xsl:stylesheet>