Hi Vijay, before you post questions, it would help if you searched for an answer. There have been numerous discussions in the forum about this and there is no one-size-fits-all solution.
That being said, have a look at this wiki page. If that doesn't suit your needs, search the forums and also google, there is a lot of posts for you to dig through.
Please do not keep creating new posts related to the same topic, it makes it far more confusing for everyone as we don't know what you have already been told.
If so, where have you got stuck and what do you not understand?
If you have not gone through this example that you say is what you are trying to achieve, then please do and then post any problems you have within this thread.
Hi Vijay, could you be a tad more specific on what is unclear to you? The instructions in this book are very detailed, so it would be helpful to know what specifically you need further clarification on.
Now we need to alter the XSLT files to look for the correct field from the displayed document.
First make sure to include the lang_lib.xslt (from step 3) in the
beginning of all XSLT files that need translations. You should add it
between the Stylesheet element and the first template element.
<xsl:include href="../xslt/lang_lib.xslt" />
You need to substitute each reference to a field with the X-path
concat function, adding the languagecode defined in lang_lib.xslt.
Example: Say, the alias name of a field is: “ALIASNAME”, we might have
this code:
Hello sebastian when i include lana_lib.xslt by above way and select xslt and click on visialize XSLT tool i m getting following error
please see the highlighted path it is not taking the xslt file from actual folder and my actual folder is D:\DATA\Projects\Umbraco 4.0.2.1\xslt
please guide me.
---------vijay.
Error parsing the XSLT:
System.Xml.Xsl.XslLoadException:
XSLT compile error. An error occurred at (10,1). --->
System.IO.DirectoryNotFoundException: Could not find a part of the path
'C:\WINDOWS\xslt\lang_lib.xslt'. at System.IO.__Error.WinIOError(Int32
errorCode, String maybeFullPath) at System.IO.FileStream.Init(String
path, FileMode mode, FileAccess access, Int32 rights, Boolean
useRights, FileShare share, Int32 bufferSize, FileOptions options,
SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize) at
System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials
credentials) at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri,
String role, Type ofObjectToReturn) at
System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver
xmlResolver) at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(Uri uri,
Boolean include) at System.Xml.Xsl.Xslt.XsltLoader.LoadInclude() at
System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet() at
System.Xml.Xsl.Xslt.XsltLoader.LoadDocument() at
System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean
include) --- End of inner exception stack trace --- at
System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean
include) at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler,
Object stylesheet, XmlResolver xmlResolver) at
System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver
xmlResolver, QilExpression& qil) at
System.Xml.Xsl.XslCompiledTransform.CompileToQil(Object stylesheet,
XsltSettings settings, XmlResolver stylesheetResolver) at
System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet,
XsltSettings settings, XmlResolver stylesheetResolver) at
System.Xml.Xsl.XslCompiledTransform.Load(XmlReader stylesheet,
XsltSettings settings, XmlResolver stylesheetResolver) at
umbraco.macro.CreateXsltTransform(XmlTextReader
I'm having this same problem. Whenever I use a xsl import or include it references direct from my local system rather than from the hosted website. Anyone know how to fix this?
<xsl:include href="../xslt/lang_lib.xslt" />
This is the line that I am using and I have tried modifying it every way possible to get it to work. Thanks.
@Petr - Thanks but I have already gone through that article to no avail. It doesn't seem to want to look for the xslt in the website directories but the directories of my local drives. Still not sure what is going on.
where do I have to write that? in which files? in my root are 2 more xslt files. The problem is that I don't know if they are used somewhere in project. As I have changed content or commented entire code from them they don't change content of the site.
How to create multiple language supported website in umbraco?
Hi all,
How to create multiple language supported website in umbraco?
Thanks in Advance,
---vijay.
Hi Vijay, before you post questions, it would help if you searched for an answer. There have been numerous discussions in the forum about this and there is no one-size-fits-all solution.
That being said, have a look at this wiki page. If that doesn't suit your needs, search the forums and also google, there is a lot of posts for you to dig through.
Hi Vijay,
Have a look at this Wiki page:
http://our.umbraco.org/wiki/how-tos/running-multi-lingual-sites-under-a-single-domain
Cheers,
Chris
It seems Sebastiaan and I had the same idea :)
Cheers,
Chris
hi all,
I m unable to understand what happening when i go through the post.
There is no specific explanation about how to create Multi language sites using umbraco in forum / in web.
I will follow the below to implement multilingual site but conversion is not happening
Please tell me about xslt creation as they mentioned in this link
http://umbraco.org/documentation/books/multilingual-11-sites/summary-of-the-multilingual-11-site-system
----vijay.
Hi Vijay,
Please do not keep creating new posts related to the same topic, it makes it far more confusing for everyone as we don't know what you have already been told.
Have you worked your way through the http://umbraco.org/documentation/books/multilingual-11-sites example?
If so, where have you got stuck and what do you not understand?
If you have not gone through this example that you say is what you are trying to achieve, then please do and then post any problems you have within this thread.
Cheers,
Chris
the points 3) to 6) i cant understand.
-----vijay
Hi Vijay, could you be a tad more specific on what is unclear to you? The instructions in this book are very detailed, so it would be helpful to know what specifically you need further clarification on.
Thanks,
Nik
Hi Nik,
Thanks for your reply.
Below i mentioned those points where i stuck.
In point mentioned below they said to add lang_lib.xslt reference to your xslt.
How to write our own xslt here. Can u give some idea what it consists of.
4) Alter all field references
Now we need to alter the XSLT files to look for the correct field from the displayed document.
First make sure to include the lang_lib.xslt (from step 3) in the beginning of all XSLT files that need translations. You should add it between the Stylesheet element and the first template element.
<xsl:include href="../xslt/lang_lib.xslt" />
You need to substitute each reference to a field with the X-path concat function, adding the languagecode defined in lang_lib.xslt. Example: Say, the alias name of a field is: “ALIASNAME”, we might have this code:
<xsl:value-of select="$currentPage/data[@alias = 'ALIASNAME']" />
- we need to change it to this:
<xsl:value-of select="$currentPage/data[@alias = concat('ALIASNAME',$flang)]" />
6) Replace “hardcoded” text with dictionary calls.
Now, we can add this extension in all XSLT files where we need dictionary translations.
What it means to all XSLT files in our code. Can u send any sample xslt file work with this code.
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.
Thanks in advance,
---vijay.
Quote: "You should add it between the Stylesheet element and the first template element."
So something like this, see the lang_lib.xslt is right after the <xsl:stylesheet> element:
Hi sebastian,
Thanks for your reply. I m getting things now.
--vijay.
Hello sebastian when i include lana_lib.xslt by above way and select xslt and click on visialize XSLT tool i m getting following error
please see the highlighted path it is not taking the xslt file from actual folder and my actual folder is D:\DATA\Projects\Umbraco 4.0.2.1\xslt
please guide me.
---------vijay.
Error parsing the XSLT:
System.Xml.Xsl.XslLoadException: XSLT compile error. An error occurred at (10,1). ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\WINDOWS\xslt\lang_lib.xslt'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver xmlResolver) at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(Uri uri, Boolean include) at System.Xml.Xsl.Xslt.XsltLoader.LoadInclude() at System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet() at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument() at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include) --- End of inner exception stack trace --- at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include) at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver) at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil) at System.Xml.Xsl.XslCompiledTransform.CompileToQil(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver) at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver) at System.Xml.Xsl.XslCompiledTransform.Load(XmlReader stylesheet, XsltSettings settings, XmlResolver stylesheetResolver) at umbraco.macro.CreateXsltTransform(XmlTextReader
Oh, that's annoying, what happens if you remove the "../xslt/" part, like this:
Hello Sebastiaan,
if i give like above it is give error like i mentioned above path is C:\WINDOWS\system32\lang_lib.xslt'.
please see the highlighted path it is not taking the xslt file from actual folder and my actual folder is D:\DATA\Projects\Umbraco 4.0.2.1\xslt.
-----vijay
I'm having this same problem. Whenever I use a xsl import or include it references direct from my local system rather than from the hosted website. Anyone know how to fix this?
<xsl:include href="../xslt/lang_lib.xslt" />
This is the line that I am using and I have tried modifying it every way possible to get it to work. Thanks.
Hi about including xslt, try look at following post
http://our.umbraco.org/forum/developers/xslt/5399-xslt-in-subfolder-with-xslinclude-or-xslimport
Petr
@Petr - Thanks but I have already gone through that article to no avail. It doesn't seem to want to look for the xslt in the website directories but the directories of my local drives. Still not sure what is going on.
Do you have C# script in one of your xslt-files by any chance? If so, remove that and see if it works then.
Peter
@Peter - I've done relatively little xslt programming but I have installed some packages. What exactly would the C# script look like. Thanks.
i am stucked in step 3 and 4.
<xsl:template match="/">
<xsl:call-template name="setlang" />
...
</xsl:template>
where do I have to write that? in which files? in my root are 2 more xslt files. The problem is that I don't know if they are used somewhere in project. As I have changed content or commented entire code from them they don't change content of the site.
in step 4
<xsl:value-of select="$currentPage/data[@alias = 'ALIASNAME']" />
- we need to change it to this:
<xsl:value-of select="$currentPage/data[@alias = concat('ALIASNAME',$flang)]" />
i do not have anywhere that piece of line :|
Please see this post too, so you can see some print screens. http://our.umbraco.org/forum/using/ui-questions/27495-Which-is-the-ideal-way-to-create-multilanguage-site
is working on a reply...