gimp-help-2 r2812 - in trunk: . stylesheets
- From: ulfehlert svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp-help-2 r2812 - in trunk: . stylesheets
- Date: Fri, 10 Apr 2009 12:44:58 +0000 (UTC)
Author: ulfehlert
Date: Fri Apr 10 12:44:58 2009
New Revision: 2812
URL: http://svn.gnome.org/viewvc/gimp-help-2?rev=2812&view=rev
Log:
2009-04-10 Ulf-D. Ehlert <ulfehlert svn gnome org>
* stylesheets/authors_common.xsl: new file containing templates
used by both authors_docbook.xsl and authors_text.xsl;
fixed a silly bug (language names were not created correctly)
* stylesheets/authors_docbook.xsl
* stylesheets/authors_text.xsl
* Makefile.GNU
* Makefile.am: changed accordingly
Added:
trunk/stylesheets/authors_common.xsl (contents, props changed)
Modified:
trunk/ChangeLog
trunk/Makefile.GNU
trunk/Makefile.am
trunk/stylesheets/authors_docbook.xsl
trunk/stylesheets/authors_text.xsl
Modified: trunk/Makefile.GNU
==============================================================================
--- trunk/Makefile.GNU (original)
+++ trunk/Makefile.GNU Fri Apr 10 12:44:58 2009
@@ -92,9 +92,17 @@
pot_dir_predicates = $(dir_predicates)
# List of authors and contributors (no DocBook)
-AUTHORS_STYLESHEET_XML = stylesheets/authors.xml
+AUTHORS_SOURCE_XML = stylesheets/authors.xml
# Automatically generated authors section (DocBook)
AUTHORS_DOCBOOK_XML = src/preface/authors.xml
+# Stylesheets generating AUTHORS
+AUTHORS_TEXT_STYLESHEETS = \
+ stylesheets/authors_text.xsl \
+ stylesheets/authors_common.xsl
+# Stylesheets generating src/preface/authors.xml
+AUTHORS_DOCBOOK_STYLESHEETS = \
+ stylesheets/authors_docbook.xsl \
+ stylesheets/authors_common.xsl
# Files & directories
ifneq "$(MAKECMDGOALS)" "help"
@@ -689,10 +697,10 @@
########################################################################
-#### AUTHORS ####
+#### Make AUTHORS file ####
########################################################################
-AUTHORS: $(AUTHORS_STYLESHEET_XML) stylesheets/authors_text.xsl $(AUTHORS_DOCBOOK_XML)
+AUTHORS: $(AUTHORS_SOURCE_XML) $(AUTHORS_TEXT_STYLESHEETS)
$(msg) "[DOC] $@"
$(cmd) $(XSLTPROC) \
$(XSLTFLAGS) $(XSLTEXTRAFLAGS) \
@@ -700,7 +708,7 @@
$< \
> $@
-$(AUTHORS_DOCBOOK_XML): $(AUTHORS_STYLESHEET_XML) stylesheets/authors_*.xsl
+$(AUTHORS_DOCBOOK_XML): $(AUTHORS_SOURCE_XML) $(AUTHORS_DOCBOOK_STYLESHEETS)
$(msg) "[SRC] $@"
$(cmd) $(call make_target_dir,$@)
$(cmd) $(XSLTPROC) \
Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am (original)
+++ trunk/Makefile.am Fri Apr 10 12:44:58 2009
@@ -103,11 +103,17 @@
src_dir_predicates = -name images -prune -o $(dir_predicates)
# list of authors and contributors (no DocBook)
-AUTHORS_STYLESHEET_XML = stylesheets/authors.xml
+AUTHORS_SOURCE_XML = stylesheets/authors.xml
# automatically generated authors section (DocBook)
AUTHORS_DOCBOOK_XML = src/preface/authors.xml
-# list of stylesheets neede to create authors src (DocBook) file
-AUTHORS_XSL_STYLESHEETS = $(wildcard stylesheets/authors_*.xsl)
+# Stylesheets generating AUTHORS
+AUTHORS_TEXT_STYLESHEETS = \
+ stylesheets/authors_text.xsl \
+ stylesheets/authors_common.xsl
+# Stylesheets generating src/preface/authors.xml
+AUTHORS_DOCBOOK_STYLESHEETS = \
+ stylesheets/authors_docbook.xsl \
+ stylesheets/authors_common.xsl
# lists of source (XML) files and source directories
SRC_DIRS = $(shell cd $(srcdir) && find src $(src_dir_predicates))
@@ -141,16 +147,16 @@
# additional files to be distributed (automake)
EXTRA_DIST = \
- AUTHORS \
- HACKING \
- INSTALL \
- TERMINOLOGY \
- $(COMMON_CSS_FILES) \
- $(OTHER_CSS_FILES) \
- $(SRC_FILES) \
- $(AUTHORS_STYLESHEET_XML) \
- $(PO_FILES) \
- $(XSL_FILES) \
+ AUTHORS \
+ HACKING \
+ INSTALL \
+ TERMINOLOGY \
+ $(COMMON_CSS_FILES) \
+ $(OTHER_CSS_FILES) \
+ $(SRC_FILES) \
+ $(AUTHORS_SOURCE_XML) \
+ $(PO_FILES) \
+ $(XSL_FILES) \
$(DIST_TOOLS)
# TODO?: rename "plainhtml.xsl" to "html.xsl" and use ...
@@ -196,7 +202,7 @@
#### Make AUTHORS file ####
########################################################################
-AUTHORS: $(AUTHORS_STYLESHEET_XML) stylesheets/authors_text.xsl $(AUTHORS_DOCBOOK_XML)
+AUTHORS: $(AUTHORS_SOURCE_XML) $(AUTHORS_TEXT_STYLESHEETS)
$(msg) "[DOC] $@"
$(cmd) $(XSLTPROC) \
$(XSLTFLAGS) $(XSLTEXTRAFLAGS) \
@@ -204,7 +210,7 @@
$< \
> $@
-$(AUTHORS_DOCBOOK_XML): $(AUTHORS_STYLESHEET_XML) $(AUTHORS_XSL_STYLESHEETS)
+$(AUTHORS_DOCBOOK_XML): $(AUTHORS_SOURCE_XML) $(AUTHORS_DOCBOOK_STYLESHEETS)
$(msg) "[SRC] $@"
$(cmd) $(call make_target_dir,$@)
$(cmd) $(XSLTPROC) \
Added: trunk/stylesheets/authors_common.xsl
==============================================================================
--- (empty file)
+++ trunk/stylesheets/authors_common.xsl Fri Apr 10 12:44:58 2009
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- template(s) common to "authors_docbook.xsl" and "author_text.xsl" -->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+
+ <!-- ============================================================= -->
+ <xsl:template name="lang.split">
+ <!-- ============================================================= -->
+ <!--
+ Convert space-separated list of language ids
+ to comma separated list of language names,
+ e.g., "de en fr" to "German, English, French"
+ -->
+ <xsl:param name="lang"/>
+ <xsl:choose>
+ <xsl:when test="contains($lang, ' ')">
+ <xsl:call-template name="print.lang">
+ <xsl:with-param name="langid" select="substring-before($lang,' ')"/>
+ </xsl:call-template>
+ <xsl:text>, </xsl:text>
+ <xsl:call-template name="lang.split">
+ <xsl:with-param name="lang" select="substring-after($lang,' ')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="print.lang">
+ <xsl:with-param name="langid" select="$lang"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ============================================================= -->
+ <xsl:template name="print.lang">
+ <!-- ============================================================= -->
+ <!--
+ Convert language id to language name (e.g., "en" to "English")
+ -->
+ <xsl:param name="langid" />
+ <!-- use underscores for spaces within languages,
+ e.g. xx:Pidgin_English -->
+ <xsl:variable name="languages">
+ cz:Czech
+ de:German
+ en:English
+ es:Spanish
+ fr:French
+ hr:Croatian
+ it:Italian
+ ko:Korean
+ lt:Lithuanian
+ nl:Dutch
+ no:Norwegian
+ pl:Polish
+ ru:Russian
+ sv:Swedish
+ zh_CN:Chinese
+ </xsl:variable>
+ <xsl:variable name="tail"
+ select="substring-after($languages,concat($langid,':'))"/>
+ <xsl:if test="$tail != ''">
+ <xsl:value-of select="translate(
+ normalize-space(substring-before($tail,' ')),
+ '_', ' ')"/>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
+
Modified: trunk/stylesheets/authors_docbook.xsl
==============================================================================
--- trunk/stylesheets/authors_docbook.xsl (original)
+++ trunk/stylesheets/authors_docbook.xsl Fri Apr 10 12:44:58 2009
@@ -7,10 +7,8 @@
xmlns:dc="http://purl.org/dc/elements/1.1/"
exclude-result-prefixes="dc">
- <!-- import template "lang.split"
- (importing instead of including should avoid
- any problems with duplicate definitions) -->
- <xsl:import href="authors_text.xsl" />
+ <!-- template "lang.split" -->
+ <xsl:import href="authors_common.xsl" />
<xsl:output method="xml" encoding="UTF-8" indent="yes"
doctype-public="-//OASIS//DTD DocBook XML V4.3//EN"
Modified: trunk/stylesheets/authors_text.xsl
==============================================================================
--- trunk/stylesheets/authors_text.xsl (original)
+++ trunk/stylesheets/authors_text.xsl Fri Apr 10 12:44:58 2009
@@ -6,6 +6,9 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <!-- template "lang.split" -->
+ <xsl:import href="authors_common.xsl" />
+
<xsl:output method="text" />
<xsl:template match="/dc:gimp-authors">
@@ -59,54 +62,4 @@
</xsl:text>
</xsl:template>
- <xsl:template name="lang.split">
- <xsl:param name="lang" />
- <xsl:choose>
- <xsl:when test="contains($lang, ' ')">
- <xsl:variable name="langid" select="substring-after($lang, ' ')" />
- <xsl:call-template name="print.lang">
- <xsl:with-param name="langid" select="$langid" />
- </xsl:call-template>
- <xsl:text>, </xsl:text>
- <xsl:call-template name="lang.split">
- <xsl:with-param name="lang" select="substring-before($lang, ' ')" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="print.lang">
- <xsl:with-param name="langid" select="$lang" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="print.lang">
- <xsl:param name="langid" />
- <!-- use underscores for spaces within languages,
- e.g. xx:Pidgin_English -->
- <xsl:variable name="languages">
- cz:Czech
- de:German
- en:English
- es:Spanish
- fr:French
- hr:Croatian
- it:Italian
- ko:Korean
- lt:Lithuanian
- nl:Dutch
- no:Norwegian
- pl:Polish
- ru:Russian
- sv:Swedish
- zh_CN:Chinese
- </xsl:variable>
- <xsl:variable name="tail"
- select="substring-after($languages,concat($langid,':'))"/>
- <xsl:if test="$tail != ''">
- <xsl:value-of select="translate(
- normalize-space(substring-before($tail,' ')),
- '_', ' ')"/>
- </xsl:if>
- </xsl:template>
</xsl:stylesheet>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]