I just tested the Multi-Language tools package. Everything works ... but not quite as I expected. I hoped that with your package, it would be possible to put relations between pages of different languages. So for instance, if you would have a page 'services' on the English website, and a page 'diensten' on the Dutch website, the administrator could set a relation between both pages, so that when a visitor on the 'services' page clicks on the language switch link, he would go automatically to the 'diensten' page.
Daniel, that package is not able to manage node relation. You can only manage relation types not the relations themselves.
Anthony, if you start with your English website and relate nodes upon copy to the Dutch site they should already be related. When your site progresses and you add nodes you can have them automatically related using the .cs file I added today to this project. If you place it in the app_code it will automatically create corresponding pages for all languagesn upon creation of a new document (on publish actually). Unfortunately there is no easy way currently to manage relationships using a GUI as I found out today in this thread.
I guess that I'll have to remove my Dutch document node and childe node and do a new copy this time with the 'relate to original' checkbox checked? I'll give that a try tonight, as for the moment I'm not on my development machine.
So if I got it correctly, once the .cs file is put in the app_code folder, and the copy of the Englisch document node is done, the user should be able to switch to another language variant of a page using the LanguageSwitcher?
You don't need the .cs file for that. The only thing the .cs file does is that when you create a new document in your English node it will automatically copy it to child nodes and relate it.
If you want to add relations to existing pages you can do that directly into the umbracoRelation table. You only need the parentid and child id which is pretty straight forward.
I recopied the English document node and checked the 'relate to original source' checkbox. If I look in the umbracoRelations table I see that the relation records between the pages are created. So do I only have to add the LanguageSwitch macro now to every page, and wil it automatically link to the same page in the other language?
Currently it will only return you a list of hyperlinks with the corresponding language but I'm working on a version with country flags and a version styled as a dropdownlist. Will package that up for tomorrow.
Hmm, I don't know if I'm doing something wrong, but it doesn't work. The link on the Dutch 'diensten' page (http://www.webmove.nl.local/diensten.aspx) links to the English 'home' page (http://www.webmove.en.local/), and on the English 'services' page, the link to the Dutch 'diensten' page points to the English domain (http://www.webmove.en.local/services.aspx)
I have checked the umbracoRelations table, the id's between parentId and childId are correct. I have installed also Hendy's Relation Types package (see screenshot). Could this package be interfering?
Hendy's package shouldn't interfere with mine at all. I have them both installed also.
Only thing I could think of, other than some huge bug in my code, is that your cache is messed up because of the delete en re-copy of the nodes you just did. This can be fixed by republishing the rootnode, could you try that?
Hi Yannick, the relateDocumentOnCopy was first set to Bidirectional. Because this didn't worked I set it to Parent to Child.
I tested again, and changed the setting back to Bidirectional. Than I did a reload nodes and repulbish of the root node and now the LanguageSwitcher macro works !!
I'm looking forward to the next changes of your package
Hi Anthony, thanks for testing my package, glad it's all working now. I've done some more enhancements and packaged it up for a v1 release, hope you like it!
i admits that i didnt have the chance to test your package yet, but the idea is very nice. thanks.
feature suggestion:
when i develop multilingual site, sometime i need to change also some CSS files, when the user pick different language. usually its because each language have different layout - for example hebrew is RTL (right to left) and english is LTR (left to right).
there are different ways to implemets solution to this problem, and this is just one idea:
1. create config file that do the mapping between language/hostname and files. for example: en --> /css/style_en.css, /css/lightbox_en.css he --> /css/style_he.css, /css/lightbox_he.css
2. create new macro that read the config file, gets the current language, and loads the right files for this language.
3. put the macro inside the template that need to do the actual include for these CSS's.
the result will be that when the user picks language from your language picker, it also reloads the right CSS's for this language.
Don't think this is necessary. Do you have useDomainPrefixes set to true in your config\umbracoSettings.config? This setting should be true for running this kind of multi-node multilanguage setup otherwise you'll end up with duplicate inconsistent urls.
Also don't forget to republish your entire site after changing the setting.
just tested multi-language tools
Hi Yannick,
I just tested the Multi-Language tools package. Everything works ... but not quite as I expected. I hoped that with your package, it would be possible to put relations between pages of different languages. So for instance, if you would have a page 'services' on the English website, and a page 'diensten' on the Dutch website, the administrator could set a relation between both pages, so that when a visitor on the 'services' page clicks on the language switch link, he would go automatically to the 'diensten' page.
Or is this possible with your tool?
Thanks for your work,
Anthony
There is a package to manage node relations here: http://our.umbraco.org/projects/developer-tools/relation-types
Daniel, that package is not able to manage node relation. You can only manage relation types not the relations themselves.
Anthony, if you start with your English website and relate nodes upon copy to the Dutch site they should already be related. When your site progresses and you add nodes you can have them automatically related using the .cs file I added today to this project. If you place it in the app_code it will automatically create corresponding pages for all languagesn upon creation of a new document (on publish actually).
Unfortunately there is no easy way currently to manage relationships using a GUI as I found out today in this thread.
Hi Yannick,
I guess that I'll have to remove my Dutch document node and childe node and do a new copy this time with the 'relate to original' checkbox checked? I'll give that a try tonight, as for the moment I'm not on my development machine.
So if I got it correctly, once the .cs file is put in the app_code folder, and the copy of the Englisch document node is done, the user should be able to switch to another language variant of a page using the LanguageSwitcher?
thanks for your advice,
Anthony
You don't need the .cs file for that. The only thing the .cs file does is that when you create a new document in your English node it will automatically copy it to child nodes and relate it.
If you want to add relations to existing pages you can do that directly into the umbracoRelation table. You only need the parentid and child id which is pretty straight forward.
Hi Yannick,
I recopied the English document node and checked the 'relate to original source' checkbox. If I look in the umbracoRelations table I see that the relation records between the pages are created. So do I only have to add the LanguageSwitch macro now to every page, and wil it automatically link to the same page in the other language?
Thanks for your advice,
Anthony
That's correct!
Currently it will only return you a list of hyperlinks with the corresponding language but I'm working on a version with country flags and a version styled as a dropdownlist. Will package that up for tomorrow.
Hmm, I don't know if I'm doing something wrong, but it doesn't work. The link on the Dutch 'diensten' page (http://www.webmove.nl.local/diensten.aspx) links to the English 'home' page (http://www.webmove.en.local/), and on the English 'services' page, the link to the Dutch 'diensten' page points to the English domain (http://www.webmove.en.local/services.aspx)
Maybe I should page the LanguageSwitch macro on all the English pages béfore I make a copy of the English document node.
Or maybe I should change the relation type in de developer section (see screenshot):
Anthony
It doesn't matter if you add the macro before or after the copy. It's just a view on the data.
Strange behavior! Could you check your umbracoRelations table to see if the relations are correct in the database?
I have checked the umbracoRelations table, the id's between parentId and childId are correct. I have installed also Hendy's Relation Types package (see screenshot). Could this package be interfering?
Hendy's package shouldn't interfere with mine at all. I have them both installed also.
Only thing I could think of, other than some huge bug in my code, is that your cache is messed up because of the delete en re-copy of the nodes you just did. This can be fixed by republishing the rootnode, could you try that?
Hey just noticed that your relateDocumentOnCopy says Parent to Child for direction. This should be Bidirectional by default i think!
Hi Yannick, the relateDocumentOnCopy was first set to Bidirectional. Because this didn't worked I set it to Parent to Child.
I tested again, and changed the setting back to Bidirectional. Than I did a reload nodes and repulbish of the root node and now the LanguageSwitcher macro works !!
I'm looking forward to the next changes of your package
greetings,
Anthony
Hi Anthony, thanks for testing my package, glad it's all working now. I've done some more enhancements and packaged it up for a v1 release, hope you like it!
Hi,
i admits that i didnt have the chance to test your package yet, but the idea is very nice. thanks.
feature suggestion:
when i develop multilingual site, sometime i need to change also some CSS files, when the user pick different language. usually its because each language have different layout - for example hebrew is RTL (right to left) and english is LTR (left to right).
there are different ways to implemets solution to this problem, and this is just one idea:
1. create config file that do the mapping between language/hostname and files. for example:
en --> /css/style_en.css, /css/lightbox_en.css
he --> /css/style_he.css, /css/lightbox_he.css
2. create new macro that read the config file, gets the current language, and loads the right files for this language.
3. put the macro inside the template that need to do the actual include for these CSS's.
the result will be that when the user picks language from your language picker, it also reloads the right CSS's for this language.
What do you think?
hi Eran, thanks for the suggestion but I don't think it's worth putting that logic in a package as it consist of just 1 line of code.
You could either do:
now you can name your css's like this style_en-US.css, style_nl-NL.css.
Alternatively you could put your language codes in a dictionaryitem, might be faster, not sure.
i think that you are right, that should do the job too, as long as you consist this naming convention.
thanks.
hey, i'm having the same issue
i get a wrong link, i have the relations in database and they are biodirectional.
what can i check?
i fixed it, i changed in The Functions File
the following condtion
What did you change? I compared your code with my Functions file but couldn't see any differences.
before the line was
Don't think this is necessary. Do you have useDomainPrefixes set to true in your config\umbracoSettings.config? This setting should be true for running this kind of multi-node multilanguage setup otherwise you'll end up with duplicate inconsistent urls.
Also don't forget to republish your entire site after changing the setting.
is working on a reply...