diff options
author | Paul W. Frields <stickster@gmail.com> | 2005-12-24 16:30:56 +0000 |
---|---|---|
committer | Paul W. Frields <stickster@gmail.com> | 2005-12-24 16:30:56 +0000 |
commit | 55f356d01333ea63f967475f83412077c0685f3d (patch) | |
tree | 339a1dc66c0ea66cc324e8dfa56a0bb409ff1942 /packaging | |
parent | 3da903b849bccf694ce89f0e8821d0fa5bca2a44 (diff) | |
download | fedora-doc-utils-55f356d01333ea63f967475f83412077c0685f3d.tar.gz fedora-doc-utils-55f356d01333ea63f967475f83412077c0685f3d.tar.xz fedora-doc-utils-55f356d01333ea63f967475f83412077c0685f3d.zip |
Never mind, we can do this with XSLT instead, thanks to MegaCoder
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/fedora-doc-gnome.desktop.in.common | 10 | ||||
-rw-r--r-- | packaging/gnome-desktop.xsl | 44 |
2 files changed, 44 insertions, 10 deletions
diff --git a/packaging/fedora-doc-gnome.desktop.in.common b/packaging/fedora-doc-gnome.desktop.in.common deleted file mode 100644 index 3779ca0..0000000 --- a/packaging/fedora-doc-gnome.desktop.in.common +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Categories=X-Fedora-Documentation; -Name=@TITLE@ -GenericName=@TITLE@ -Exec=gnome-help file:///usr/share/fedora/doc/fedora-doc-@DOCBASE@/C/@DOCBASE@-en.xml -Icon=icon-documentation.png -Terminal=false -Type=Application -Comment=Official Fedora documentation diff --git a/packaging/gnome-desktop.xsl b/packaging/gnome-desktop.xsl new file mode 100644 index 0000000..6dd1ee1 --- /dev/null +++ b/packaging/gnome-desktop.xsl @@ -0,0 +1,44 @@ +<!-- Transform rpm-info.xml into a .desktop file for GNOME --> +<xsl:stylesheet version="1.0" xml:space="preserve" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output encoding="UTF-8" indent="no" method="text" omit-xml-declaration="yes" standalone="no" version="1.0"/> + +<!-- Note: do not indent this file! Any whitespace here + will be reproduced in the output --> + + <xsl:param name="lang" select="'en'" /> + <xsl:param name="docbase" select="'example-tutorial'" /> + +<xsl:template match="/">[Desktop Entry] +Encoding=UTF-8 +Categories=X-Fedora-Documentation; +Name=<xsl:value-of select="/rpm-info/titles/translation[@lang='en']/title"/> +GenericName=<xsl:value-of select="/rpm-info/titles/translation[@lang='en']/title"/> +Exec=gnome-help file:///usr/share/fedora/doc/fedora-doc-<xsl:value-of + select="$docbase"/>/C/<xsl:value-of select="$docbase"/>-en.xml + +<xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang != 'en'">Name[<xsl:value-of + select="@lang"/>]=<xsl:value-of + select="/rpm-info/titles/translation[@lang]/title"/></xsl:if></xsl:for-each> +<xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang != + 'en'">Exec[<xsl:value-of select="@lang"/>]=gnome-help file:///usr/share/fedora/doc/fedora-doc-<xsl:value-of + select="$docbase"/>/<xsl:value-of select="@lang"/>/<xsl:value-of + select="$docbase"/>-<xsl:value-of + select="@lang"/>.xml</xsl:if></xsl:for-each> + +Icon=icon-documentation.png +Terminal=false +Type=Application +ShowOnlyIn=GNOME; +</xsl:template> + + <xsl:template name="get-title"> + <xsl:for-each select="/rpm-info/titles/translation"> + <xsl:choose> + <xsl:when test="@lang = $lang"> + <xsl:value-of select="title"/> + </xsl:when> + </xsl:choose> + </xsl:for-each> + </xsl:template> + +</xsl:stylesheet> |