Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Byron Delgado 47 posts 70 karma points
    Jan 11, 2011 @ 23:40
    Byron Delgado
    0

    Multilingual 1:1 help information needed

    Hi, I am new in Umbraco, our company is looking forward to use Umbraco as our main CMS solution for our clients. One of the main features we need to implement is to facilitate multilingual 1:1 pages, this is because some sections are going to be populated by a lot of items, and editors would like to have every translation in the same item (node).

    For what I have seen in this forum everyone making reference to a "Multilingual 1:1 book" tutorial at

    http://umbraco.org/documentation/books/multilingual-11-sites

    but the link is broken. Anyone knows where to find this guide or a similar one.

    Any help is very appreciated.

  • Sascha Wolter 615 posts 1101 karma points
    Jan 12, 2011 @ 00:32
    Sascha Wolter
    0

    Hi Byron,

    Can't find that document anymore either, but I stumbled across this nice slideshow by Paul Marden: http://www.slideshare.net/mardenpb1/multi-lingual-websites-in-umbraco

    It uses a combination of separate branches for each language and the tabbed system (aka 1:1), this should give you some ideas on how this will work and look.

    Any specific questions please don't hesitate to ask here!

    Hope that helps,

    Sascha

  • Byron Delgado 47 posts 70 karma points
    Jan 12, 2011 @ 00:47
    Byron Delgado
    0

    Thanks Sascha,

    Still I'd like to see a tutorial about this. In the slides the author mentions that editors prefer a tabbed solution, besides the author proposes to relate every document to its translated equivalent with the help content picker, if a website has 4 languages then every document translation has to be related 4 times between themselves, this will become very messy I guess, especially for editors ina very populated site.

    It will be great to find an example about Multilingual 1:1, I have been looking everywhere : (

    Byron

     

  • Byron Delgado 47 posts 70 karma points
    Jan 13, 2011 @ 16:54
    Byron Delgado
    0

    I found this post  where it provides a combination of .net and XSLT macros to retrieve values from the Dictionary and DocumentType properties according to the current language, the language is worked out by using a .Net class's methods. In the first code sample it identifies the browser language in order to set the language to show; in the other sample it checks the requested query string. I implemented the last sample and it is working so far, I just went through some problems because the XSLT described was not done for the Umbraco 4.5, so I created some samples too:

    This xslt Gets the dictionary value according to the referenced language

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <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:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:Best="urn:Best" xmlns:Language="urn:Language" 
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets Best Language ">
    
    
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    
    
    
    <xsl:param name="currentPage"/>
    <xsl:param name="dictionaryKey" select="/macro/dictionaryKey"/> 
    <xsl:param name="lang" select="Language:GetSessionLanguage()"/> 
    
    <xsl:template match="/">
    
    <!-- the if avoids errors when saving the xslt, beacause the parameter values do not exist here, they
      are assigned from the template-->
    <xsl:if test="$lang and $dictionaryKey"> 
        <xsl:value-of select="Language:GetDictionaryItemByKey($dictionaryKey)"/>
    </xsl:if>
    
    </xsl:template>
    
    </xsl:stylesheet>?

    The Language tag was defined in the umbraco xsltExtensions.config, which adds the extension for the .Net class for language retrievals. The parameter dictionaryKey is referenced from the template, and the parameter lang is obtained by using the .Net class

    Additionally I made another one (based on the article before mentioned) for the properties

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <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:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:Best="urn:Best" xmlns:Language="urn:Language" 
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets Best Language ">
    
    
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    
    <xsl:param name="currentPage"/>
    <xsl:variable name="propertyName" select="/macro/propertyName" />
    <xsl:param name="lang" select="Language:GetSessionLanguage()"/> 
    
    
    <xsl:template match="/">
    <xsl:if test="$lang"> 
    
      <xsl:value-of select="$currentPage/*[name() = concat($propertyName,$lang)]" disable-output-escaping="yes" />
      </xsl:if>
    </xsl:template>
    
    </xsl:stylesheet>

    The variable propertyName is set in the template. The site is going to have properties named as bodyText_en, bodyText_es, ...etc. Every page is going to have a tab containing the respective language DocumentType properties. The template will call this XSLT everytime it renders a property. In this one I had a hard time trying to figure out

    "$currentPage/*[name() = concat($propertyName,$lang)]" 

    but with the help of another forum I managed to make it work. I have still to find a way to select media accoding to this method.

    Anyone is welcome to give suggestions please. I am thinking whether to actually create .Net functions for these retrievals.

    Umbraco is a CMS that makes sense

Please Sign in or register to post replies

Write your reply to:

Draft