Sorry if this has been covered before chaps, but i am a little confused!
Basicall, there seems to be two methods toward a multilingual site, one being the 1:1 approach which uses a lot of XSLT stuff and dictionary items (which i don't fully understand!). The other just being as basic structure of the website:
The basic site structure is my proffered way as it allows for each language to be individualised and indexed on its own.
My only worry is that i would have a hard coded language selector on the top of each page which means if someone were on the page EN, About us and wanted to switch to that page in FR, they would be taken back to the homepage and have to navigate again...
I know its not a major issue, but is there a way around this or am i asking too much!
I'm not a big fan of the 1:1 approach either... Your problem can definitely be solved by creating a small xslt snippet.
I've done something like this in the past... But, if I remember right, i created a usercontrol instead of writing xslt code... (While the xslt way should be more performant.)
If you like, i'll search through my code tonight and post it here.
So basically, instead of an XSLT you would have a user control like a Tab (language links) Then a content picker for the alternative page in each language...
You dont even need to use the umbraco api for this.
If i remember right, i just catched the request url and build my other language links based on this.... But, I'm sure there are better ways, using xslt. I just happened to choose for the quick solution. :)
There are various options for how to handle this, from a content-picker on the content nodes, to some sort of algorithm you can use to 'look up' an equivalent page, to using the relations api.
But let me make one observation... very rarely does one visit a multi-lingual site, select a language and navigate to a page, and then want to see that page in another language. Why would anyone do that? Instead, people see the language selector and make their choice and that's it. You don't suddenly think to yourself, I wonder if it says the same thing in German as in Arabic or English.
Besides, not every page is going to have an equivalent page in every language, for most sites anyway. The marketing campaigns and products and services and staff appropriate are often different from one culture to another.
In short, you CAN do what you want but I'd question if you SHOULD do what you originally asked.
In any case, do let us know how you resolve the issue for the benefit of the next person trying to do the same thing.
I had wondered that myself, and I am only trying to match an existing site. The client in question is Swiss based and operate globally. You will know that the Swiss speak a number of languages as there is not one Mother-tounge. So this may well be one of those rare websites where the user may wish to view the page in different language.
Hi, I had to do this in the past for a Brussels based company (Dutch - French). They wanted to implement a CMS for an already existing website with a language selector on each page.
My quick fix was to build a usercontrol like this:
Partial Class LanguageSelector Inherits System.Web.UI.UserControl
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim currentPath As String = Request.Url.ToString
If currentPath.tolower.Contains("/fr/") Then outputLabel.Text = "<a href=""" & currentPath.Replace("/fr/", "/nl/") & """>NL</a> | <strong>FR</strong>" ElseIf currentPath.tolower.Contains("/nl/") Then outputLabel.Text = "<strong>NL</strong> | <a href=""" & currentPath.Replace("/nl/", "/fr/") & """>FR</a> | <a href=""" & currentPath.Replace("/nl/", "/en/")" End If
End Sub End Class
I know... far from perfect coding, but just to give you an idea. :) (It would be better to catch the possible languages through the umbraco api or at least pass an array to the usercontrol.)
When a non existing url was hit, i redirected the visitor to the homepage (in the selected language).
Having a language selector on each page is indeed not very useful for a random visitor. But my client liked to keep it. Because he could easily compare the content of a webpage in the different languages.
Most non English surfers are used to the fact that websites are mostly in English. And just go look for a language selector when they find a webpage that really interests them. In this case, it can be useful to redirect them to the right page immediately.
Muiltilingual Site - links to 'mirror' pages
Sorry if this has been covered before chaps, but i am a little confused!
Basicall, there seems to be two methods toward a multilingual site, one being the 1:1 approach which uses a lot of XSLT stuff and dictionary items (which i don't fully understand!). The other just being as basic structure of the website:
content
--Global Homepage
----EN
--------Pages
----FR
--------Pages
etc..
The basic site structure is my proffered way as it allows for each language to be individualised and indexed on its own.
My only worry is that i would have a hard coded language selector on the top of each page which means if someone were on the page EN, About us and wanted to switch to that page in FR, they would be taken back to the homepage and have to navigate again...
I know its not a major issue, but is there a way around this or am i asking too much!
Thanks guys
Hi,
I'm not a big fan of the 1:1 approach either... Your problem can definitely be solved by creating a small xslt snippet.
I've done something like this in the past... But, if I remember right, i created a usercontrol instead of writing xslt code... (While the xslt way should be more performant.)
If you like, i'll search through my code tonight and post it here.
Chris
That would be wicked!
So basically, instead of an XSLT you would have a user control like a Tab (language links) Then a content picker for the alternative page in each language...
That makes sense...
Yep, that's right.
You dont even need to use the umbraco api for this.
If i remember right, i just catched the request url and build my other language links based on this.... But, I'm sure there are better ways, using xslt. I just happened to choose for the quick solution. :)
Thanks chris, very helpful!
There are various options for how to handle this, from a content-picker on the content nodes, to some sort of algorithm you can use to 'look up' an equivalent page, to using the relations api.
But let me make one observation... very rarely does one visit a multi-lingual site, select a language and navigate to a page, and then want to see that page in another language. Why would anyone do that? Instead, people see the language selector and make their choice and that's it. You don't suddenly think to yourself, I wonder if it says the same thing in German as in Arabic or English.
Besides, not every page is going to have an equivalent page in every language, for most sites anyway. The marketing campaigns and products and services and staff appropriate are often different from one culture to another.
In short, you CAN do what you want but I'd question if you SHOULD do what you originally asked.
In any case, do let us know how you resolve the issue for the benefit of the next person trying to do the same thing.
cheers,
doug.
Thanks Doug.
I had wondered that myself, and I am only trying to match an existing site. The client in question is Swiss based and operate globally. You will know that the Swiss speak a number of languages as there is not one Mother-tounge. So this may well be one of those rare websites where the user may wish to view the page in different language.
But, it is still rather far-fetched!
Hi, I had to do this in the past for a Brussels based company (Dutch - French). They wanted to implement a CMS for an already existing website with a language selector on each page.
My quick fix was to build a usercontrol like this:
I know... far from perfect coding, but just to give you an idea. :) (It would be better to catch the possible languages through the umbraco api or at least pass an array to the usercontrol.)
When a non existing url was hit, i redirected the visitor to the homepage (in the selected language).
Having a language selector on each page is indeed not very useful for a random visitor. But my client liked to keep it. Because he could easily compare the content of a webpage in the different languages.
Maybe another useful situation.
Most non English surfers are used to the fact that websites are mostly in English. And just go look for a language selector when they find a webpage that really interests them. In this case, it can be useful to redirect them to the right page immediately.
is working on a reply...