comparison xsls/menu.xsls @ 706:cd0d1f0130db

Fixed language switcher.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 04 Oct 2012 15:02:32 +0000
parents 095d1972dad9
children c3a1cf38f19e
comparison
equal deleted inserted replaced
705:e159f385c62b 706:cd0d1f0130db
23 } else { 23 } else {
24 24
25 <!-- 25 <!--
26 -- If a menu item has the switchlang attribute, then it will point 26 -- If a menu item has the switchlang attribute, then it will point
27 -- to the same document in the specified language. 27 -- to the same document in the specified language.
28 -- The document will be taken from $NOLANGORIGIN variable.
29 --> 28 -->
30 X:if "@switchlang != ''" { 29 X:if "$TRANS and @switchlang" {
31 30
32 <!-- 31 <!--
33 -- Check if list of available translations ($TRANS) contains 32 -- Check if list of available translations ($TRANS) contains
34 -- the language we are going to generate link to. 33 -- the language we are going to generate link to.
35 -- If yes - generate link, otherwise just name the language. 34 -- If yes - generate link, otherwise just name the language.
36 --> 35 -->
37 X:if "contains($TRANS, @switchlang)" { 36 X:if "contains($TRANS, @switchlang)" {
38 <a> 37 <a>
39 X:attribute "href" { 38 X:attribute "href" {
40 X:if "$ROOT != '' " { 39 !{ concat($ROOT, '/', @switchlang, '/',
41 !{ concat($ROOT, '/', @switchlang, '/', $NOLANGORIGIN) } 40 substring-after($LINK, concat('/', $LANG, '/'))) }
42 } else { 41 }
43 !{ concat(@switchlang, '/', $NOLANGORIGIN) } 42 !{ normalize-space(text()) }
44 }
45 }
46 !{ normalize-space(text()) }
47 </a> 43 </a>
48 44
49 } else { 45 } else {
50 <a class="notrans"> !{ normalize-space(text()) } </a> 46 <a class="notrans"> !{ normalize-space(text()) } </a>
51 } 47 }
52 } else { 48 } else {
53 49
54 <a> 50 <a>
55 X:attribute "href" { 51 X:attribute "href" {
60 } else { 56 } else {
61 !{ substring-after(@href, $DIRNAME) } 57 !{ substring-after(@href, $DIRNAME) }
62 } 58 }
63 59
64 } else { 60 } else {
65
66 !{ concat($ROOT, @href) } 61 !{ concat($ROOT, @href) }
67 } 62 }
68 } 63 }
69 !{ normalize-space(text()) } 64 !{ normalize-space(text()) }
70 </a> 65 </a>