Improve transtable.{xml,xsl}, including:
- The structure of transtable.xml is revised. <word> should be bracketed with <group>. - A sorting order of the FreeBSD mirror sites rendered using mirrors.xml has been determined by sort(1). - A template "transtable-lookup" has been added for localization on word-by-word basis. - Replace English month names in news.xml, press.xml, and advisories.xml with numbers that correspond to the names. The number->name translation is performed on the fly. - Since information in mirrors.xml is used in www/ tree, it depends on doc/ tree now. When WITHOUT_DOC is defined it can be built without doc/ tree, but some information becomes unavailable. For example, a list of the mirror sites generated in index.html becomes a dummy one, and calling "transtable-lookup" with a word returns the word itself. Neither www/ nor doc/ build should be broken due to this commit, but until the necessary changes are applied in the localized directories, the transtable does not work; it simply generates non-localized contents even if transtable.xsl is used.
This commit is contained in:
parent
f4273f2cd9
commit
2e2010fbb7
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=19617
11 changed files with 487 additions and 268 deletions
en_US.ISO8859-1/books/handbook
ja_JP.eucJP/share/sgml
share
|
@ -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'" \
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
<group id="country">
|
||||
<word>
|
||||
<orig>Central Servers</orig>
|
||||
<tran>中央サーバ</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Primary Mirror Sites</orig>
|
||||
<tran>一次ミラーサイト</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Primary Mirror Sites</orig>
|
||||
<tran>一次ミラーサイト</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Argentina</orig>
|
||||
<tran>アルゼンチン</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Argentina</orig>
|
||||
<tran>アルゼンチン</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Australia</orig>
|
||||
<tran>オーストラリア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Australia</orig>
|
||||
<tran>オーストラリア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Austria</orig>
|
||||
<tran>オーストリア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Austria</orig>
|
||||
<tran>オーストリア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Belgium</orig>
|
||||
<tran>ベルギー</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Belgium</orig>
|
||||
<tran>ベルギー</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Brazil</orig>
|
||||
<tran>ブラジル</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Brazil</orig>
|
||||
<tran>ブラジル</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Bulgaria</orig>
|
||||
<tran>ブルガリア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Bulgaria</orig>
|
||||
<tran>ブルガリア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Canada</orig>
|
||||
<tran>カナダ</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Canada</orig>
|
||||
<tran>カナダ</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>China</orig>
|
||||
<tran>中国</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>China</orig>
|
||||
<tran>中国</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Croatia</orig>
|
||||
<tran>クロアチア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Croatia</orig>
|
||||
<tran>クロアチア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Czech Republic</orig>
|
||||
<tran>チェコ共和国</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Czech Republic</orig>
|
||||
<tran>チェコ共和国</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Denmark</orig>
|
||||
<tran>デンマーク</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Denmark</orig>
|
||||
<tran>デンマーク</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Estonia</orig>
|
||||
<tran>エストニア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Estonia</orig>
|
||||
<tran>エストニア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Finland</orig>
|
||||
<tran>フィンランド</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Finland</orig>
|
||||
<tran>フィンランド</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>France</orig>
|
||||
<tran>フランス</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>France</orig>
|
||||
<tran>フランス</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Germany</orig>
|
||||
<tran>ドイツ</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Germany</orig>
|
||||
<tran>ドイツ</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Greece</orig>
|
||||
<tran>ギリシア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Greece</orig>
|
||||
<tran>ギリシア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Hong Kong</orig>
|
||||
<tran>香港</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Hong Kong</orig>
|
||||
<tran>香港</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Hungary</orig>
|
||||
<tran>ハンガリー</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Hungary</orig>
|
||||
<tran>ハンガリー</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Iceland</orig>
|
||||
<tran>アイスランド</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Iceland</orig>
|
||||
<tran>アイスランド</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Ireland</orig>
|
||||
<tran>アイルランド</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Ireland</orig>
|
||||
<tran>アイルランド</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Italy</orig>
|
||||
<tran>イタリア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Italy</orig>
|
||||
<tran>イタリア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Japan</orig>
|
||||
<tran>日本</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Japan</orig>
|
||||
<tran>日本</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Korea</orig>
|
||||
<tran>韓国</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Korea</orig>
|
||||
<tran>韓国</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Kuwait</orig>
|
||||
<tran>クウェート</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Kuwait</orig>
|
||||
<tran>クウェート</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Latvia</orig>
|
||||
<tran>ラトビア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Latvia</orig>
|
||||
<tran>ラトビア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Lithuania</orig>
|
||||
<tran>リトアニア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Lithuania</orig>
|
||||
<tran>リトアニア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Netherlands</orig>
|
||||
<tran>オランダ</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Netherlands</orig>
|
||||
<tran>オランダ</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>New Zealand</orig>
|
||||
<tran>ニュージーランド</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>New Zealand</orig>
|
||||
<tran>ニュージーランド</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Norway</orig>
|
||||
<tran>ノルウェー</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Norway</orig>
|
||||
<tran>ノルウェー</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Philippines</orig>
|
||||
<tran>フィリピン</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Philippines</orig>
|
||||
<tran>フィリピン</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Poland</orig>
|
||||
<tran>ポーランド</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Poland</orig>
|
||||
<tran>ポーランド</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Portugal</orig>
|
||||
<tran>ポルトガル</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Portugal</orig>
|
||||
<tran>ポルトガル</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Romania</orig>
|
||||
<tran>ルーマニア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Romania</orig>
|
||||
<tran>ルーマニア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Russia</orig>
|
||||
<tran>ロシア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Russia</orig>
|
||||
<tran>ロシア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>San Marino</orig>
|
||||
<tran>サンマリノ</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>San Marino</orig>
|
||||
<tran>サンマリノ</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Saudi Arabia</orig>
|
||||
<tran>サウジアラビア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Saudi Arabia</orig>
|
||||
<tran>サウジアラビア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Singapore</orig>
|
||||
<tran>シンガポール</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Singapore</orig>
|
||||
<tran>シンガポール</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Slovak Republic</orig>
|
||||
<tran>スロバキア共和国</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Slovak Republic</orig>
|
||||
<tran>スロバキア共和国</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Slovenia</orig>
|
||||
<tran>スロベニア</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Slovenia</orig>
|
||||
<tran>スロベニア</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>South Africa</orig>
|
||||
<tran>南アフリカ</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>South Africa</orig>
|
||||
<tran>南アフリカ</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Spain</orig>
|
||||
<tran>スペイン</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Spain</orig>
|
||||
<tran>スペイン</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Sweden</orig>
|
||||
<tran>スウェーデン</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Sweden</orig>
|
||||
<tran>スウェーデン</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Switzerland</orig>
|
||||
<tran>スイス</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Switzerland</orig>
|
||||
<tran>スイス</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Taiwan</orig>
|
||||
<tran>台湾</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Taiwan</orig>
|
||||
<tran>台湾</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Turkey</orig>
|
||||
<tran>トルコ</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Turkey</orig>
|
||||
<tran>トルコ</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>Ukraine</orig>
|
||||
<tran>ウクライナ</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>Ukraine</orig>
|
||||
<tran>ウクライナ</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>United Kingdom</orig>
|
||||
<tran>イギリス</tran>
|
||||
</word>
|
||||
<word>
|
||||
<orig>United Kingdom</orig>
|
||||
<tran>イギリス</tran>
|
||||
</word>
|
||||
|
||||
<word>
|
||||
<orig>USA</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>
|
||||
|
|
|
@ -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)
|
||||
|
@ -98,13 +101,6 @@ _WWW_LANGCODE:= ${_WWW2_LANGCODE}
|
|||
.endif
|
||||
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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
50
share/sgml/transtable-common.xsl
Normal file
50
share/sgml/transtable-common.xsl
Normal file
|
@ -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>
|
|
@ -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>
|
||||
|
|
|
@ -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:param name="transtable-target-element" select="''" />
|
||||
<xsl:param name="transtable-word-group" select="''" />
|
||||
<xsl:param name="transtable-mode" 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: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"> </xsl:text>
|
||||
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue