Written by
torleik
For umbraco versions:
umbraco3.0How-to
How to create multilingual sites with only a single navigation-tree,
> using 'tabbed translation' and the dictionary.
Now, we can add this extension in all XSLT files where we need dictionary translations.
First we need to add the namespace declaration in the stylesheet element:
<xsl:stylesheet
version="1.0"
xmlns:xsl=http://www.w3.org/1999/XSL/Transform
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
xmlns:kv_trans ="urn:kv_trans"
exclude-result-prefixes="msxml umbraco.library kv_trans">
...
(The added code is highlighted.)
Then we can use it this way anywhere in our XSLT file:
<xsl:value-of select="kv_trans:translate('KEY',string($dlang))" />
Where the ‘KEY’ is the dictionary key for the entry, as explained in step 5.
Again, change the namespace and aliasname to what you used above, in step 5.