Solprovider Lenya Kongregate Registration for Free Flash Games and Chat with solprovider

Letting Visitors Change Languages

Letting visitors choose language


Pass "language" and "querystring" to the XSL:
FILE: publication-sitemap.xmap
<map:match pattern="lenyabody-*/*/*/*/**">
...
<map:transform src="xslt/page2xhtml-{4}.xsl">
<map:parameter name="root" value="{page-envelope:context-prefix}/{2}/{3}"/>
<map:parameter name="url" value="{5}"/>
<map:parameter name="document-id" value="{page-envelope:document-id}"/>
<map:parameter name="document-type" value="{page-envelope:document-type}"/>
<map:parameter name="language" value="{page-envelope:document-language}"/> <!-- Add this line -->
<map:parameter name="querystring" value="{request:queryString}"/> <!-- Add this line -->
</map:transform>


FILE: page2xhtml.xsl
Add new parameters near the top:
<xsl:param name="root"/>
<xsl:param name="document-id"/>
<xsl:param name="url"/>
<xsl:param name="language"/>
<xsl:param name="querystring"/>
<xsl:variable name="ext">
<xsl:value-of select="substring-after($url, '.')" /><xsl:if test="$querystring != ''">?<xsl:value-of select="$querystring"/></xsl:if>
</xsl:variable>


Where the language selection is:
<xsl:if test="$language != 'en'">
<A HREF="{$root}{$document-id}_en.{$ext}">English</A>
</xsl:if>
<xsl:if test="$language != 'es'">
<A HREF="{$root}{$document-id}_es.{$ext}">Espanol</A>
</xsl:if>


<< Initial LanguageSetting Visitor Language >>

Contact Solprovider
Paul Ercolino