Hi all, Im new to the forum so im not sure if this has been addressed before.
I have an issue with translating languages using inline XSLT. I followed the tutorials to create language types, tabs and dictionary items. This all works fine. I have a couple of links on the homepage that passes through the language codes via a querystring. Now, the tutorial shoes how to translate the languages but only in the XSLT files.
I need to translate the content in the umbraco page items not the XSLT.
Inline XSLT for languages
Hi all, Im new to the forum so im not sure if this has been addressed before.
I have an issue with translating languages using inline XSLT.
I followed the tutorials to create language types, tabs and dictionary items. This all works fine. I have a couple of links on the homepage that passes through the language codes via a querystring.
Now, the tutorial shoes how to translate the languages but only in the XSLT files.
I need to translate the content in the umbraco page items not the XSLT.
Heres what I have:
<%@ Master Language="C#" MasterPageFile="/masterpages/BritanniaMaster.master" AutoEventWireup="true" %>
<asp:Content id="BritanniaHomepagecontent" ContentPlaceHolderID="BritanniaMasterContentPlaceHolder" runat="server">
<div id=langselect>
<a href="?lang=en">English</a> |
<a href="?lang=fr">French</a> |
<a href="?lang=de">German</a>
</div>
<h2><umbraco:Item field="pageHeading" runat="server" xslt="concat(umbraco.library:GetXmlNodeById({0})/@nodeName,$flang)"></umbraco:Item></h2>
<p><umbraco:Item field="siteIntroduction" runat="server" xslt="concat(umbraco.library:GetXmlNodeById({0})/@nodeName,$flang)"></umbraco:Item></p>
I know the inline XSLT here is incorrect but it gives you an idea of what I need to do.
Can anyone help me out with the correct inline XSLT please?
Many thanks
Rog
The other thing is that the item field names above seem to be wrong. In my document type, the tabs have aliases like this:
pageHeading_en
pageHeading_fr
pageHeading_de
How does the page know what language is the default? Also, which one of these do I put in the itme field on page or do I just omit the _en/_fr/_de
Please give some ideas on this.
Thanks!
No one know an answer?
Hi, it doesn't matter how your tabs are named, is important how you name properties, for example bodyText_en, bodyText_de :
<p><umbraco:Item field="bodyText" runat="server" xslt="umbraco.library:GetXmlNodeById({0})/data[@alias = 'bodyText_' + $flang])" /></p>
Not tested, just sample ...
is working on a reply...