Press Ctrl / CMD + C to copy this to your clipboard.
Copied to clipboard
Flag this post as spam?
This post will be reported to the moderators as potential spam to be looked at
Topic author was deleted
Sep 04, 2012 @ 21:09
Feedback regarding our Polyglot Install
First off, Polyglot has been working great for us. However we've made some tweaks that work for us better in the long run that I wanted to share with the community.
First off, we are no longer using the LanguageSelector.xslt. We are using something similar called TranslationNodePicker.xslt which is shown below (note the usual extension and header tags have been excluded):
The above XSLT brings in the 'currentPage' param and returns either the currentPage node (if default language (english in this case)) or the translated node through the variable 'translatedCurrentPage'.
This makes the downstream XSLT a bit easier to work with IMHO. Take for example the following XSLT that includes the above:
The second XSLT does not bring in the currentPage param. This is done automatically during the 'include'.
The second XSLT does not refer to 'currentPage', instead it only refers to 'translatedCurrentPage' whose value is set in the first XSLT. Now the second XSLT only needs to refer to the property name.
This method has been stress tested with a fairly large cache file (~30MB) with great results.
And finally, macros were not caching properly b/c the language needs to use the query string which is not apart of the caching mechanism. So with a little help from this blog, we were able to cache Polyglot enabled macros.
The secret with the caching is to set the lang param to the macro like this from the template:
Topic author was deleted
Feedback regarding our Polyglot Install
First off, Polyglot has been working great for us. However we've made some tweaks that work for us better in the long run that I wanted to share with the community.
First off, we are no longer using the LanguageSelector.xslt. We are using something similar called TranslationNodePicker.xslt which is shown below (note the usual extension and header tags have been excluded):
The above XSLT brings in the 'currentPage' param and returns either the currentPage node (if default language (english in this case)) or the translated node through the variable 'translatedCurrentPage'.
This makes the downstream XSLT a bit easier to work with IMHO. Take for example the following XSLT that includes the above:
A few things to note:
For our top Navigation, we are using this:
And finally, macros were not caching properly b/c the language needs to use the query string which is not apart of the caching mechanism. So with a little help from this blog, we were able to cache Polyglot enabled macros.
The secret with the caching is to set the lang param to the macro like this from the template:
Umbraco caches the macro based on the parameters. Be sure to add 'Lang' to your macro property lists.
I just wanted to pass along some lessons learned along the way with Polyglot. Post comments and errors in my logic here for the masses.
Thanks Dimitri!
Wow, thanks for all the feedback Kevin! I'll keep these things in mind for future versions.
Best regards,
Dimitri
is working on a reply...