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