[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: [FILE] XSL templates used for I18N in Kivio
From: Nicolas Goutte <nicolasg () snafu ! de>
Date: 2003-12-24 9:28:08
[Download RAW message or body]
Attached are the XSL templates that I have used for extracting the I18N data
of the SML shapes and of the shape description, in Kivio.
They are rather quick&dirty. (This email is more to avoid giving the
impression that I would not publish the templates.)
Use (adapt the paths if necessary):
xsltproc kivio-extract-i18n-desc `find koffice/kivio -name "desc"` > koffice/
kivio/kivio-desc-i18n.cpp
xsltproc kivio-extract-i18n-sml `find koffice/kivio -name "*.sml"` > koffice/
kivio/kivio-sml-i18n.cpp
Have a nice day!
["kivio-extract-i18n-desc.xslt" (text/x-xslt)]
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Copyright 2003 Nicolas GOUTTE <goutte@kde.org>
License GPL 2
-->
<!-- WARNING: if you modify this file, be careful about newlines
(or they end in the result if the XML rules do not tell to drop them.) -->
<xsl:output method="text" indent="no" media-type="text/plain" \
omit-xml-declaration="yes" encoding="UTF-8"/> <!-- Match the whole document and then \
use a for-each to avoid to have one new line for each element of the source file. \
--> <xsl:template match="/">
<xsl:for-each select="/KivioStencilSpawnerSetCollection">
<xsl:if test="boolean(Title)">i18n("Stencils","<xsl:value-of \
select="Title/@data"/>") // Title (Collection) </xsl:if> </xsl:for-each>
<xsl:for-each select="/KivioStencilSpawnerSet">
<xsl:if test="boolean(Title)">i18n("Stencils","<xsl:value-of \
select="Title/@data"/>") // Title </xsl:if> </xsl:for-each>
</xsl:template>
</xsl:stylesheet>
["kivio-extract-i18n-sml.xslt" (text/x-xslt)]
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Copyright 2003 Nicolas GOUTTE <goutte@kde.org>
License GPL 2
-->
<!-- WARNING: if you modify this file, be careful about newlines
(or they end in the result if the XML rules do not tell to drop them.) -->
<xsl:output method="text" indent="no" media-type="text/plain" \
omit-xml-declaration="yes" encoding="UTF-8"/> <!-- Match the whole document and then \
use a for-each to avoid to have one new line for each element of the source file. \
--> <xsl:template match="/">
<xsl:for-each select="/KivioShapeStencil/KivioSMLStencilSpawnerInfo">
<xsl:if test="boolean(Title)">i18n("Stencils","<xsl:value-of \
select="Title/@data"/>") // Title </xsl:if> <xsl:if \
test="boolean(Description)">i18n("Stencils","<xsl:value-of \
select="Description/@data"/>") // Description </xsl:if> </xsl:for-each>
</xsl:template>
</xsl:stylesheet>
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic