Search

Hi, I want to add multilanguage in front end of my site. That is each user can select their language from a drop down list and want to change all contents of the site to that language. How is it possible in symphony

Please search both the forum and the extensions directory for "multilingual" before going any further.

I had done with multilingual extension, it working fine when the language entered in the url, but i don't know how to get the language in a drop down list for my requeirement.

Hi anwarsidhu

Do you have the language_redirect extension installed?

Then you will have a language-redirect output on the debug page:

http://yourdomain.ch/en/page/?debug

It looks like this.

<language-redirect>
        <current-language handle="en">English</current-language>
        <supported-languages>
            <item handle="de">Deutsch</item>
            <item handle="fr">français</item>
            <item handle="en">English</item>
        </supported-languages>
    </language-redirect>

so now its very easy to make a dropdown.

<xsl:template name="sprachwahl">
<xsl:param name="supported-language-codes" select="/data/events/language-redirect/supported-languages/item/@handle"/>
<xsl:param name="current-language-code" select="/data/events/language-redirect/current-language/@handle"/>
    <xsl:for-each select="$supported-language-codes">
            <xsl:choose>
                <xsl:when test=". = $current-language-code">
                    <span><xsl:value-of select="."/></span>
                </xsl:when>
                <xsl:otherwise>
               <a href="{$root}/{.}"><xsl:value-of select="."/></a>
                </xsl:otherwise>
            </xsl:choose>
    </xsl:for-each>

That's the selector i use....

@all I have some problems to give out the Item names for example Deutsch / Français / English...

Thanks dotspion, its perfectly working now.

@dotspion, i have a problem here, i can't apply this to drop down lists. Any option to do this, or any extension which supports drop down lists.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details