diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/entities/Makefile | 8 | ||||
-rw-r--r-- | common/entities/README.txt | 31 | ||||
-rw-r--r-- | common/entities/entities-en.xml | 16 | ||||
-rw-r--r-- | common/entities/entities.dtd | 2 | ||||
-rw-r--r-- | common/entities/entities.xsl | 38 |
5 files changed, 83 insertions, 12 deletions
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( '<!ENTITY ', @name, ' ', normalize-space($extra), ' "', normalize-space($body), '" > <!-- ', normalize-space($desc), ' -->')" 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">'/></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( '<!ENTITY ', $name, ' ', normalize-space($extra), ' "', normalize-space($body), '" > <!-- ', normalize-space($desc), ' -->')" disable-output-escaping="yes"/> + </xsl:template> + </xsl:stylesheet> |