aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2004-01-12 21:27:01 +0000
committerHiroki Sato <hrs@FreeBSD.org>2004-01-12 21:27:01 +0000
commit2e2010fbb75d53befabff5c52ad9762da9459008 (patch)
tree70460d988b6cd725d93a65e991e6358d74e7f550
parentf4273f2cd909f2f3e7f0322d984a61e0df22a6ac (diff)
Notes
-rw-r--r--en_US.ISO8859-1/books/handbook/Makefile2
-rw-r--r--ja_JP.eucJP/share/sgml/mirrors-local.xsl5
-rw-r--r--ja_JP.eucJP/share/sgml/transtable-local.xsl4
-rw-r--r--ja_JP.eucJP/share/sgml/transtable.xml574
-rw-r--r--share/mk/doc.common.mk33
-rw-r--r--share/sgml/mirrors-local.xsl4
-rw-r--r--share/sgml/mirrors-master.xsl15
-rw-r--r--share/sgml/transtable-common.xsl50
-rw-r--r--share/sgml/transtable-local.xsl7
-rw-r--r--share/sgml/transtable-master.xsl83
-rw-r--r--share/sgml/transtable.xml78
11 files changed, 537 insertions, 318 deletions
diff --git a/en_US.ISO8859-1/books/handbook/Makefile b/en_US.ISO8859-1/books/handbook/Makefile
index f11f0f4fa8..157d298b40 100644
--- a/en_US.ISO8859-1/books/handbook/Makefile
+++ b/en_US.ISO8859-1/books/handbook/Makefile
@@ -223,7 +223,6 @@ CLEANFILES+= eresources.sgml.www.inc.tmp
mirrors.sgml.${p}.inc: ${XML_MIRRORS} ${XSL_MIRRORS}
${XSLTPROC} ${XSLTPROCOPTS} \
-o $@.tmp \
- --param 'transtable.xml' "'${XML_TRANSTABLE}'" \
--param 'type' "'$p'" \
--param 'proto' "'$p'" \
--param 'target' "'handbook/mirrors/chapter.sgml'" \
@@ -236,7 +235,6 @@ mirrors.sgml.${p}.inc: ${XML_MIRRORS} ${XSL_MIRRORS}
eresources.sgml.www.inc: ${XML_MIRRORS} ${XSL_MIRRORS}
${XSLTPROC} ${XSLTPROCOPTS} \
-o $@.tmp \
- --param 'transtable.xml' "'${XML_TRANSTABLE}'" \
--param 'type' "'www'" \
--param 'proto' "'http'" \
--param 'target' "'handbook/eresources/chapter.sgml'" \
diff --git a/ja_JP.eucJP/share/sgml/mirrors-local.xsl b/ja_JP.eucJP/share/sgml/mirrors-local.xsl
index 1a23c69216..ca0170a0ba 100644
--- a/ja_JP.eucJP/share/sgml/mirrors-local.xsl
+++ b/ja_JP.eucJP/share/sgml/mirrors-local.xsl
@@ -10,11 +10,6 @@
omit-xml-declaration="yes"
indent="yes"/>
- <!-- these params should be externally bound. The values
- here are not used actually -->
- <xsl:param name="proto" select="''" />
- <xsl:param name="target" select="''" />
-
<!-- template: "mirrors-docbook-contact" -->
<xsl:template name="mirrors-docbook-contact">
diff --git a/ja_JP.eucJP/share/sgml/transtable-local.xsl b/ja_JP.eucJP/share/sgml/transtable-local.xsl
index d1b0e7f6b7..e4e5521c32 100644
--- a/ja_JP.eucJP/share/sgml/transtable-local.xsl
+++ b/ja_JP.eucJP/share/sgml/transtable-local.xsl
@@ -9,8 +9,4 @@
<xsl:output type="xml" encoding="euc-jp"
indent="yes"/>
- <!-- these params should be externally bound. The values
- here are not used actually -->
- <xsl:param name="transtable.xml" select="'./transtable.xml'" />
- <xsl:param name="transtable-conv-element" select="''" />
</xsl:stylesheet>
diff --git a/ja_JP.eucJP/share/sgml/transtable.xml b/ja_JP.eucJP/share/sgml/transtable.xml
index 3318cd3a85..ef3f2b49b8 100644
--- a/ja_JP.eucJP/share/sgml/transtable.xml
+++ b/ja_JP.eucJP/share/sgml/transtable.xml
@@ -3,13 +3,15 @@
<!--
- This is a translation table used in transtable-master.xsl.
+ This is a translation table used in transtable-common.xsl.
For example:
- <word>
- <orig>word in English</orig>
- <tran>word in your language</tran>
- </word>
+ <group id="word-group">
+ <word>
+ <orig>word in English</orig>
+ <tran>word in your language</tran>
+ </word>
+ </group>
-->
@@ -20,253 +22,317 @@
</cvs:keyword>
</cvs:keywords>
- <word>
- <orig>Central Servers</orig>
- <tran>中央サーバ</tran>
- </word>
-
- <word>
- <orig>Primary Mirror Sites</orig>
- <tran>一次ミラーサイト</tran>
- </word>
-
- <word>
- <orig>Argentina</orig>
- <tran>アルゼンチン</tran>
- </word>
-
- <word>
- <orig>Australia</orig>
- <tran>オーストラリア</tran>
- </word>
-
- <word>
- <orig>Austria</orig>
- <tran>オーストリア</tran>
- </word>
-
- <word>
- <orig>Belgium</orig>
- <tran>ベルギー</tran>
- </word>
-
- <word>
- <orig>Brazil</orig>
- <tran>ブラジル</tran>
- </word>
-
- <word>
- <orig>Bulgaria</orig>
- <tran>ブルガリア</tran>
- </word>
-
- <word>
- <orig>Canada</orig>
- <tran>カナダ</tran>
- </word>
-
- <word>
- <orig>China</orig>
- <tran>中国</tran>
- </word>
-
- <word>
- <orig>Croatia</orig>
- <tran>クロアチア</tran>
- </word>
-
- <word>
- <orig>Czech Republic</orig>
- <tran>チェコ共和国</tran>
- </word>
-
- <word>
- <orig>Denmark</orig>
- <tran>デンマーク</tran>
- </word>
-
- <word>
- <orig>Estonia</orig>
- <tran>エストニア</tran>
- </word>
-
- <word>
- <orig>Finland</orig>
- <tran>フィンランド</tran>
- </word>
-
- <word>
- <orig>France</orig>
- <tran>フランス</tran>
- </word>
-
- <word>
- <orig>Germany</orig>
- <tran>ドイツ</tran>
- </word>
-
- <word>
- <orig>Greece</orig>
- <tran>ギリシア</tran>
- </word>
-
- <word>
- <orig>Hong Kong</orig>
- <tran>香港</tran>
- </word>
-
- <word>
- <orig>Hungary</orig>
- <tran>ハンガリー</tran>
- </word>
-
- <word>
- <orig>Iceland</orig>
- <tran>アイスランド</tran>
- </word>
-
- <word>
- <orig>Ireland</orig>
- <tran>アイルランド</tran>
- </word>
-
- <word>
- <orig>Italy</orig>
- <tran>イタリア</tran>
- </word>
-
- <word>
- <orig>Japan</orig>
- <tran>日本</tran>
- </word>
-
- <word>
- <orig>Korea</orig>
- <tran>韓国</tran>
- </word>
-
- <word>
- <orig>Kuwait</orig>
- <tran>クウェート</tran>
- </word>
-
- <word>
- <orig>Latvia</orig>
- <tran>ラトビア</tran>
- </word>
-
- <word>
- <orig>Lithuania</orig>
- <tran>リトアニア</tran>
- </word>
-
- <word>
- <orig>Netherlands</orig>
- <tran>オランダ</tran>
- </word>
-
- <word>
- <orig>New Zealand</orig>
- <tran>ニュージーランド</tran>
- </word>
-
- <word>
- <orig>Norway</orig>
- <tran>ノルウェー</tran>
- </word>
-
- <word>
- <orig>Philippines</orig>
- <tran>フィリピン</tran>
- </word>
-
- <word>
- <orig>Poland</orig>
- <tran>ポーランド</tran>
- </word>
-
- <word>
- <orig>Portugal</orig>
- <tran>ポルトガル</tran>
- </word>
-
- <word>
- <orig>Romania</orig>
- <tran>ルーマニア</tran>
- </word>
-
- <word>
- <orig>Russia</orig>
- <tran>ロシア</tran>
- </word>
-
- <word>
- <orig>San Marino</orig>
- <tran>サンマリノ</tran>
- </word>
-
- <word>
- <orig>Saudi Arabia</orig>
- <tran>サウジアラビア</tran>
- </word>
-
- <word>
- <orig>Singapore</orig>
- <tran>シンガポール</tran>
- </word>
-
- <word>
- <orig>Slovak Republic</orig>
- <tran>スロバキア共和国</tran>
- </word>
-
- <word>
- <orig>Slovenia</orig>
- <tran>スロベニア</tran>
- </word>
-
- <word>
- <orig>South Africa</orig>
- <tran>南アフリカ</tran>
- </word>
-
- <word>
- <orig>Spain</orig>
- <tran>スペイン</tran>
- </word>
-
- <word>
- <orig>Sweden</orig>
- <tran>スウェーデン</tran>
- </word>
-
- <word>
- <orig>Switzerland</orig>
- <tran>スイス</tran>
- </word>
-
- <word>
- <orig>Taiwan</orig>
- <tran>台湾</tran>
- </word>
-
- <word>
- <orig>Turkey</orig>
- <tran>トルコ</tran>
- </word>
-
- <word>
- <orig>Ukraine</orig>
- <tran>ウクライナ</tran>
- </word>
-
- <word>
- <orig>United Kingdom</orig>
- <tran>イギリス</tran>
- </word>
-
- <word>
- <orig>USA</orig>
- <tran>アメリカ合衆国</tran>
- </word>
+ <group id="country">
+ <word>
+ <orig>Central Servers</orig>
+ <tran>中央サーバ</tran>
+ </word>
+
+ <word>
+ <orig>Primary Mirror Sites</orig>
+ <tran>一次ミラーサイト</tran>
+ </word>
+
+ <word>
+ <orig>Argentina</orig>
+ <tran>アルゼンチン</tran>
+ </word>
+
+ <word>
+ <orig>Australia</orig>
+ <tran>オーストラリア</tran>
+ </word>
+
+ <word>
+ <orig>Austria</orig>
+ <tran>オーストリア</tran>
+ </word>
+
+ <word>
+ <orig>Belgium</orig>
+ <tran>ベルギー</tran>
+ </word>
+
+ <word>
+ <orig>Brazil</orig>
+ <tran>ブラジル</tran>
+ </word>
+
+ <word>
+ <orig>Bulgaria</orig>
+ <tran>ブルガリア</tran>
+ </word>
+
+ <word>
+ <orig>Canada</orig>
+ <tran>カナダ</tran>
+ </word>
+
+ <word>
+ <orig>China</orig>
+ <tran>中国</tran>
+ </word>
+
+ <word>
+ <orig>Croatia</orig>
+ <tran>クロアチア</tran>
+ </word>
+
+ <word>
+ <orig>Czech Republic</orig>
+ <tran>チェコ共和国</tran>
+ </word>
+
+ <word>
+ <orig>Denmark</orig>
+ <tran>デンマーク</tran>
+ </word>
+
+ <word>
+ <orig>Estonia</orig>
+ <tran>エストニア</tran>
+ </word>
+
+ <word>
+ <orig>Finland</orig>
+ <tran>フィンランド</tran>
+ </word>
+
+ <word>
+ <orig>France</orig>
+ <tran>フランス</tran>
+ </word>
+
+ <word>
+ <orig>Germany</orig>
+ <tran>ドイツ</tran>
+ </word>
+
+ <word>
+ <orig>Greece</orig>
+ <tran>ギリシア</tran>
+ </word>
+
+ <word>
+ <orig>Hong Kong</orig>
+ <tran>香港</tran>
+ </word>
+
+ <word>
+ <orig>Hungary</orig>
+ <tran>ハンガリー</tran>
+ </word>
+
+ <word>
+ <orig>Iceland</orig>
+ <tran>アイスランド</tran>
+ </word>
+
+ <word>
+ <orig>Ireland</orig>
+ <tran>アイルランド</tran>
+ </word>
+
+ <word>
+ <orig>Italy</orig>
+ <tran>イタリア</tran>
+ </word>
+
+ <word>
+ <orig>Japan</orig>
+ <tran>日本</tran>
+ </word>
+
+ <word>
+ <orig>Korea</orig>
+ <tran>韓国</tran>
+ </word>
+
+ <word>
+ <orig>Kuwait</orig>
+ <tran>クウェート</tran>
+ </word>
+
+ <word>
+ <orig>Latvia</orig>
+ <tran>ラトビア</tran>
+ </word>
+
+ <word>
+ <orig>Lithuania</orig>
+ <tran>リトアニア</tran>
+ </word>
+
+ <word>
+ <orig>Netherlands</orig>
+ <tran>オランダ</tran>
+ </word>
+
+ <word>
+ <orig>New Zealand</orig>
+ <tran>ニュージーランド</tran>
+ </word>
+
+ <word>
+ <orig>Norway</orig>
+ <tran>ノルウェー</tran>
+ </word>
+
+ <word>
+ <orig>Philippines</orig>
+ <tran>フィリピン</tran>
+ </word>
+
+ <word>
+ <orig>Poland</orig>
+ <tran>ポーランド</tran>
+ </word>
+
+ <word>
+ <orig>Portugal</orig>
+ <tran>ポルトガル</tran>
+ </word>
+
+ <word>
+ <orig>Romania</orig>
+ <tran>ルーマニア</tran>
+ </word>
+
+ <word>
+ <orig>Russia</orig>
+ <tran>ロシア</tran>
+ </word>
+
+ <word>
+ <orig>San Marino</orig>
+ <tran>サンマリノ</tran>
+ </word>
+
+ <word>
+ <orig>Saudi Arabia</orig>
+ <tran>サウジアラビア</tran>
+ </word>
+
+ <word>
+ <orig>Singapore</orig>
+ <tran>シンガポール</tran>
+ </word>
+
+ <word>
+ <orig>Slovak Republic</orig>
+ <tran>スロバキア共和国</tran>
+ </word>
+
+ <word>
+ <orig>Slovenia</orig>
+ <tran>スロベニア</tran>
+ </word>
+
+ <word>
+ <orig>South Africa</orig>
+ <tran>南アフリカ</tran>
+ </word>
+
+ <word>
+ <orig>Spain</orig>
+ <tran>スペイン</tran>
+ </word>
+
+ <word>
+ <orig>Sweden</orig>
+ <tran>スウェーデン</tran>
+ </word>
+
+ <word>
+ <orig>Switzerland</orig>
+ <tran>スイス</tran>
+ </word>
+
+ <word>
+ <orig>Taiwan</orig>
+ <tran>台湾</tran>
+ </word>
+
+ <word>
+ <orig>Turkey</orig>
+ <tran>トルコ</tran>
+ </word>
+
+ <word>
+ <orig>Ukraine</orig>
+ <tran>ウクライナ</tran>
+ </word>
+
+ <word>
+ <orig>United Kingdom</orig>
+ <tran>イギリス</tran>
+ </word>
+
+ <word>
+ <orig>USA</orig>
+ <tran>アメリカ合衆国</tran>
+ </word>
+ </group>
+
+ <group id="number-month">
+ <word>
+ <orig>1</orig>
+ <tran>1 月</tran>
+ </word>
+
+ <word>
+ <orig>2</orig>
+ <tran>2 月</tran>
+ </word>
+
+ <word>
+ <orig>3</orig>
+ <tran>3 月</tran>
+ </word>
+
+ <word>
+ <orig>4</orig>
+ <tran>4 月</tran>
+ </word>
+
+ <word>
+ <orig>5</orig>
+ <tran>5 月</tran>
+ </word>
+
+ <word>
+ <orig>6</orig>
+ <tran>6 月</tran>
+ </word>
+
+ <word>
+ <orig>7</orig>
+ <tran>7 月</tran>
+ </word>
+
+ <word>
+ <orig>8</orig>
+ <tran>8 月</tran>
+ </word>
+
+ <word>
+ <orig>9</orig>
+ <tran>9 月</tran>
+ </word>
+
+ <word>
+ <orig>10</orig>
+ <tran>10 月</tran>
+ </word>
+
+ <word>
+ <orig>11</orig>
+ <tran>11 月</tran>
+ </word>
+
+ <word>
+ <orig>12</orig>
+ <tran>12 月</tran>
+ </word>
+ </group>
</transtable>
diff --git a/share/mk/doc.common.mk b/share/mk/doc.common.mk
index 1ccd364892..4b36bbc409 100644
--- a/share/mk/doc.common.mk
+++ b/share/mk/doc.common.mk
@@ -5,6 +5,9 @@
# documents commonly used in doc/ and www/ tree.
#
+AWK?= /usr/bin/awk
+GREP?= /usr/bin/grep
+
.if defined(DOC_PREFIX) && !empty(DOC_PREFIX)
WEB_PREFIX?= ${DOC_PREFIX}/../www
.elif defined(WEB_PREFIX) && !empty(WEB_PREFIX)
@@ -100,13 +103,6 @@ WWW_LANGCODE?= ${_WWW_LANGCODE}
# ------------------------------------------------------------------------
#
-# advisories.xml dependency.
-#
-
-XML_ADVISORIES= ${WEB_PREFIX}/share/sgml/advisories.xml
-
-# ------------------------------------------------------------------------
-#
# mirrors.xml dependency.
#
@@ -122,6 +118,7 @@ XSL_MIRRORS= ${DOC_PREFIX}/share/sgml/mirrors-local.xsl
.endif
XSL_TRANSTABLE_MASTER= ${DOC_PREFIX}/share/sgml/transtable-master.xsl
+XSL_TRANSTABLE_COMMON= ${DOC_PREFIX}/share/sgml/transtable-common.xsl
.if exists(${DOC_PREFIX}/${LANGCODE}/share/sgml/transtable-local.xsl)
XSL_TRANSTABLE= ${DOC_PREFIX}/${LANGCODE}/share/sgml/transtable-local.xsl
@@ -135,13 +132,29 @@ XML_TRANSTABLE= ${DOC_PREFIX}/${LANGCODE}/share/sgml/transtable.xml
XML_TRANSTABLE= ${DOC_PREFIX}/share/sgml/transtable.xml
.endif
-${XSL_MIRRORS}: ${XSL_MIRRORS_MASTER}
+${XSL_MIRRORS}: ${XSL_MIRRORS_MASTER} ${XSL_TRANSTABLE_COMMON}
-${XML_MIRRORS}: ${XML_MIRRORS_MASTER} ${XSL_TRANSTABLE} ${XSL_TRANSTABLE_MASTER}
+${XML_MIRRORS}: ${XML_MIRRORS_MASTER} ${XSL_TRANSTABLE} ${XSL_TRANSTABLE_MASTER} ${XSL_TRANSTABLE_COMMON}
${MKDIR} -p ${@:H}
+ ${XSLTPROC} ${XSLTPROCOPTS} \
+ --param 'transtable.xml' "'${XML_TRANSTABLE}'" \
+ --param 'transtable-target-element' "'country'" \
+ --param 'transtable-word-group' "'country'" \
+ --param 'transtable-mode' "'sortkey'" \
+ ${XSL_TRANSTABLE} ${XML_MIRRORS_MASTER} \
+ | env -i LANG="${LANGCODE}" ${SORT} -f > $@.sort.tmp
+ env -i ${GREP} "^<?xml" < $@.sort.tmp > $@.sort
+ ${ECHO} "<sortkeys>" >> $@.sort
+ env -i ${AWK} '/^ / {sub(/@sortkey@/, ++line); print;}' < $@.sort.tmp >> $@.sort
+ ${ECHO} '</sortkeys>' >> $@.sort
${XSLTPROC} ${XSLTPROCOPTS} -o $@ \
--param 'transtable.xml' "'${XML_TRANSTABLE}'" \
- --param 'transtable-conv-element' "'country'" \
+ --param 'transtable-target-element' "'country'" \
+ --param 'transtable-word-group' "'country'" \
+ --param 'transtable-sortkey.xml' "'$@.sort'" \
${XSL_TRANSTABLE} ${XML_MIRRORS_MASTER}
+ ${RM} -f $@.sort $@.sort.tmp
CLEANFILES+= ${XML_MIRRORS}
+CLEANFILES+= ${XML_MIRRORS}.sort
+CLEANFILES+= ${XML_MIRRORS}.sort.tmp
diff --git a/share/sgml/mirrors-local.xsl b/share/sgml/mirrors-local.xsl
index 4fff70caa7..786463bdeb 100644
--- a/share/sgml/mirrors-local.xsl
+++ b/share/sgml/mirrors-local.xsl
@@ -10,8 +10,4 @@
omit-xml-declaration="yes"
indent="yes"/>
- <!-- these params should be externally bound. The values
- here are not used actually -->
- <xsl:param name="proto" select="''" />
- <xsl:param name="target" select="''" />
</xsl:stylesheet>
diff --git a/share/sgml/mirrors-master.xsl b/share/sgml/mirrors-master.xsl
index cd13a0f6cf..dffb2709e2 100644
--- a/share/sgml/mirrors-master.xsl
+++ b/share/sgml/mirrors-master.xsl
@@ -68,15 +68,16 @@
<xsl:template name="mirrors-docbook-country-index-all">
<para>
- <xsl:for-each select="mirrors/entry[country/@role = 'primary' and
- host[@type = $type]]">
+ <xsl:for-each select="mirrors/entry[country/@role = 'primary'
+ and host[@type = $type]]">
<xsl:call-template name="mirrors-docbook-country-index">
<xsl:with-param name="mirrors-docbook-country-index-without-period" select="'true'" />
</xsl:call-template>
</xsl:for-each>
- <xsl:for-each select="mirrors/entry[country/@role != 'primary' and
+ <xsl:for-each select="mirrors/entry[(not(country/@role) or country/@role != 'primary') and
host[@type = $type]]">
+ <xsl:sort select="country/@sortkey" data-type="number"/>
<xsl:sort select="country" />
<xsl:call-template name="mirrors-docbook-country-index">
@@ -109,8 +110,9 @@
<xsl:call-template name="mirrors-docbook-variablelist-entry" />
</xsl:for-each>
- <xsl:for-each select="mirrors/entry[country/@role != 'primary' and
+ <xsl:for-each select="mirrors/entry[(not(country/@role) or country/@role != 'primary') and
host[@type = $type]]">
+ <xsl:sort select="country/@sortkey" data-type="number"/>
<xsl:sort select="country" />
<xsl:call-template name="mirrors-docbook-variablelist-entry" />
@@ -194,9 +196,10 @@
<xsl:call-template name="mirrors-docbook-itemizedlist-listitem" />
</xsl:for-each>
- <xsl:for-each select="mirrors/entry[country/@role != 'primary' and
+ <xsl:for-each select="mirrors/entry[(not(country/@role) or country/@role != 'primary') and
host[@type = $type]]">
- <xsl:sort select="country" />
+ <xsl:sort select="country/@sortkey" data-type="number"/>
+ <xsl:sort select="country" />
<xsl:call-template name="mirrors-docbook-itemizedlist-listitem" />
</xsl:for-each>
diff --git a/share/sgml/transtable-common.xsl b/share/sgml/transtable-common.xsl
new file mode 100644
index 0000000000..2b9ebaedfe
--- /dev/null
+++ b/share/sgml/transtable-common.xsl
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- $FreeBSD$ -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <!-- these params should be externally bound. The values
+ here are not used actually -->
+ <xsl:param name="transtable.xml" select="'./transtable.xml'" />
+ <xsl:param name="transtable-sortkey.xml" select="'./transtable-sortkey.xml'" />
+
+ <xsl:key name="transtable-lookup-key" match="word" use="orig" />
+ <xsl:key name="transtable-sortkey-lookup-key" match="word" use="@orig" />
+
+ <xsl:template name="transtable-lookup">
+ <xsl:param name="word" select="''"/>
+ <xsl:param name="word-group" select="''"/>
+
+ <xsl:choose>
+ <xsl:when test="document($transtable.xml)/transtable/group[@id = $word-group]">
+ <xsl:for-each select="document($transtable.xml)/transtable/group[@id = $word-group]">
+ <xsl:choose>
+ <xsl:when test="key('transtable-lookup-key', $word)">
+ <xsl:for-each select="key('transtable-lookup-key', $word)">
+ <xsl:value-of select="tran" />
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$word" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$word" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="transtable-sortkey-lookup">
+ <xsl:param name="word" select="''"/>
+
+ <xsl:for-each select="document($transtable-sortkey.xml)/sortkeys">
+ <xsl:for-each select="key('transtable-sortkey-lookup-key', $word)">
+ <xsl:attribute name="sortkey">
+ <xsl:value-of select="@sortkey" />
+ </xsl:attribute>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/share/sgml/transtable-local.xsl b/share/sgml/transtable-local.xsl
index 25ae67845f..70e7a29c45 100644
--- a/share/sgml/transtable-local.xsl
+++ b/share/sgml/transtable-local.xsl
@@ -12,5 +12,10 @@
<!-- these params should be externally bound. The values
here are not used actually -->
<xsl:param name="transtable.xml" select="'./transtable.xml'" />
- <xsl:param name="transtable-conv-element" select="''" />
+ <xsl:param name="transtable-sortkey.xml" select="'./transtable-sortkey.xml'" />
+
+ <xsl:param name="transtable-target-element" select="''" />
+ <xsl:param name="transtable-word-group" select="''" />
+ <xsl:param name="transtable-mode" select="''" />
+
</xsl:stylesheet>
diff --git a/share/sgml/transtable-master.xsl b/share/sgml/transtable-master.xsl
index 2eda63fa62..0c78fe0721 100644
--- a/share/sgml/transtable-master.xsl
+++ b/share/sgml/transtable-master.xsl
@@ -3,31 +3,26 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:import href="./transtable-common.xsl" />
+
<xsl:output type="xml" encoding="iso-8859-1"
indent="yes"/>
<!-- these params should be externally bound. The values
here are not used actually -->
- <xsl:param name="transtable.xml" select="'./transtable.xml'" />
- <xsl:param name="transtable-conv-element" select="''" />
-
- <xsl:key name="transtable-lookup-key" match="word" use="orig" />
-
- <xsl:template name="transtable-lookup">
- <xsl:param name="word" select="''"/>
-
- <xsl:for-each select="document($transtable.xml)">
- <xsl:choose>
- <xsl:when test="key('transtable-lookup-key', $word)">
- <xsl:for-each select="key('transtable-lookup-key', $word)">
- <xsl:value-of select="tran" />
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$word" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
+ <xsl:param name="transtable-target-element" select="''" />
+ <xsl:param name="transtable-word-group" select="''" />
+ <xsl:param name="transtable-mode" select="''" />
+
+ <xsl:template match="/">
+ <xsl:choose>
+ <xsl:when test="$transtable-mode = 'sortkey'">
+ <xsl:apply-templates mode="sortkey"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template match="*">
@@ -37,13 +32,59 @@
</xsl:copy>
</xsl:template>
- <xsl:template match="*[local-name() = $transtable-conv-element]">
+ <xsl:template match="*[local-name() = $transtable-target-element]">
<xsl:element name="{local-name(.)}" namespace="{namespace-uri(.)}">
<xsl:copy-of select="@*" />
+ <xsl:call-template name="transtable-sortkey-lookup">
+ <xsl:with-param name="word" select="." />
+ <xsl:with-param name="word-group" select="$transtable-word-group" />
+ </xsl:call-template>
+
<xsl:call-template name="transtable-lookup">
<xsl:with-param name="word" select="." />
+ <xsl:with-param name="word-group" select="$transtable-word-group" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- mode for generating sortkeytable -->
+
+ <xsl:template match="*" mode="sortkey">
+ <xsl:apply-templates mode="sortkey"/>
+ </xsl:template>
+
+ <xsl:template match="text()" mode="sortkey">
+ </xsl:template>
+
+ <xsl:template match="*[local-name() = $transtable-target-element]" mode="sortkey">
+ <xsl:text> </xsl:text>
+
+ <xsl:comment>
+ <xsl:call-template name="transtable-lookup">
+ <xsl:with-param name="word" select="." />
+ <xsl:with-param name="word-group" select="$transtable-word-group" />
</xsl:call-template>
+ </xsl:comment>
+
+ <xsl:element name="word">
+ <xsl:attribute name="name">
+ <xsl:call-template name="transtable-lookup">
+ <xsl:with-param name="word" select="." />
+ <xsl:with-param name="word-group" select="$transtable-word-group" />
+ </xsl:call-template>
+ </xsl:attribute>
+
+ <xsl:attribute name="orig">
+ <xsl:value-of select="." />
+ </xsl:attribute>
+
+ <xsl:attribute name="sortkey">
+ <xsl:value-of select="'@sortkey@'" />
+ </xsl:attribute>
</xsl:element>
+
+ <xsl:text disable-output-escaping="yes">&#10;</xsl:text>
+
</xsl:template>
</xsl:stylesheet>
diff --git a/share/sgml/transtable.xml b/share/sgml/transtable.xml
index 1d420bf067..c1a1b99950 100644
--- a/share/sgml/transtable.xml
+++ b/share/sgml/transtable.xml
@@ -3,13 +3,15 @@
<!--
- This is a translation table used in transtable-master.xsl.
+ This is a translation table used in transtable-common.xsl.
For example:
- <word>
- <orig>word in English)</orig>
- <tran>word in your language</tran>
- </word>
+ <group id="country">
+ <word>
+ <orig>word in English</orig>
+ <tran>word in your language</tran>
+ </word>
+ </group>
-->
@@ -20,11 +22,65 @@
</cvs:keyword>
</cvs:keywords>
-<!--
- <word>
- <orig>Primary Mirror Sites</orig>
- <tran></tran>
- </word>
--->
+ <group id="number-month">
+ <word>
+ <orig>1</orig>
+ <tran>January</tran>
+ </word>
+
+ <word>
+ <orig>2</orig>
+ <tran>February</tran>
+ </word>
+
+ <word>
+ <orig>3</orig>
+ <tran>March</tran>
+ </word>
+
+ <word>
+ <orig>4</orig>
+ <tran>April</tran>
+ </word>
+
+ <word>
+ <orig>5</orig>
+ <tran>May</tran>
+ </word>
+
+ <word>
+ <orig>6</orig>
+ <tran>June</tran>
+ </word>
+
+ <word>
+ <orig>7</orig>
+ <tran>July</tran>
+ </word>
+
+ <word>
+ <orig>8</orig>
+ <tran>August</tran>
+ </word>
+
+ <word>
+ <orig>9</orig>
+ <tran>September</tran>
+ </word>
+
+ <word>
+ <orig>10</orig>
+ <tran>October</tran>
+ </word>
+
+ <word>
+ <orig>11</orig>
+ <tran>November</tran>
+ </word>
+ <word>
+ <orig>12</orig>
+ <tran>December</tran>
+ </word>
+ </group>
</transtable>