Mercurial > hg > nginx-site
diff 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 |
line wrap: on
line diff
--- a/xsls/menu.xsls +++ b/xsls/menu.xsls @@ -25,9 +25,8 @@ X:template = "menu/item" { <!-- -- If a menu item has the switchlang attribute, then it will point -- to the same document in the specified language. - -- The document will be taken from $NOLANGORIGIN variable. --> - X:if "@switchlang != ''" { + X:if "$TRANS and @switchlang" { <!-- -- Check if list of available translations ($TRANS) contains @@ -36,18 +35,15 @@ X:template = "menu/item" { --> X:if "contains($TRANS, @switchlang)" { <a> - X:attribute "href" { - X:if "$ROOT != '' " { - !{ concat($ROOT, '/', @switchlang, '/', $NOLANGORIGIN) } - } else { - !{ concat(@switchlang, '/', $NOLANGORIGIN) } - } - } - !{ normalize-space(text()) } + X:attribute "href" { + !{ concat($ROOT, '/', @switchlang, '/', + substring-after($LINK, concat('/', $LANG, '/'))) } + } + !{ normalize-space(text()) } </a> } else { - <a class="notrans"> !{ normalize-space(text()) } </a> + <a class="notrans"> !{ normalize-space(text()) } </a> } } else { @@ -62,7 +58,6 @@ X:template = "menu/item" { } } else { - !{ concat($ROOT, @href) } } }