Version 4.2.0.1, tag libreoffice-4.2.0.1
[LibreOffice.git] / solenv / bin / uilangfilter.xslt
blob6d48974bccd2ac076f0f62577f5efcb9d8c7e4a1
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 -->
10 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
11 xmlns:str="http://exslt.org/strings">
12 <xsl:output method="xml" encoding="UTF-8"/>
14 <xsl:template match="/">
15 <l><xsl:text>&#10;</xsl:text>
16 <!--
17 What I want to do here is to extract all nodes that are translatable
18 except the columns of list and tree stores
19 -->
20 <xsl:apply-templates select="//*[not(self::col)][@translatable='yes']" />
21 <!--
22 What I want to do here is to extract just the list and tree store
23 columns that that are translatable (the first one only)
24 -->
25 <xsl:apply-templates select="interface/object[data/row/col[@id='0'][@translatable='yes']]" />
26 </l>
27 </xsl:template>
29 <!--
30 Normal nodes
31 -->
32 <xsl:template match="*/*[not(self::col|self::item)][@translatable='yes']">
33 <xsl:text> </xsl:text>
34 <t r="string" g="{str:tokenize(../@id,':')[1]}" l="{@name}">
35 <xsl:copy-of select="text()" />
36 </t><xsl:text>&#10;</xsl:text>
37 </xsl:template>
39 <!--
40 Item nodes
41 -->
42 <xsl:template match="*/*[self::item][@translatable='yes']">
43 <xsl:text> </xsl:text>
44 <xsl:variable name="groupid" select="../../@id"/>
45 <t r="stringlist" g="{str:tokenize(../../@id,':')[1]}" l="{count(preceding::item[../../@id=$groupid])}">
46 <xsl:copy-of select="text()" />
47 </t><xsl:text>&#10;</xsl:text>
48 </xsl:template>
50 <!--
51 Column nodes
52 -->
53 <xsl:template match="col[@id='0'][@translatable='yes']">
54 <xsl:text> </xsl:text>
55 <xsl:variable name="groupid" select="../../../@id"/>
56 <t r="stringlist" g="{str:tokenize($groupid,':')[1]}" l="{count(preceding::col[@id='0'][../../../@id=$groupid])}">
57 <xsl:copy-of select="text()" />
58 </t><xsl:text>&#10;</xsl:text>
59 </xsl:template>
61 <xsl:template match="text()"/>
63 </xsl:stylesheet>