Chooser multilanguage

Hi,
I try since 5 days to manage the chooser menu for differents languages with JM Deco. I install the quick start but unable to set up !!! I would like to install 3 views in 3 different languages for the main website as the quick start reference.
Please help !!!

9 answers

Profile photo of thangnn1510 0.00 $tone December 8, 2010
Public

Hi ellenuma!

Welcome back to Joomlart! Hope you enjoy using our products and services.

Regarding the problem you couldn’t setup languages switcher for JM Deco template. This is quick solution for adding a language switcher to the top menu:

-- Open: app\design\frontend\default\jm_deco\layout\catalog .xml then find this line:

HTML Code:

<block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/>

Change it to:

HTML Code:

 <block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml">
                <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
            </block>

-- Edit app\design\frontend\default\jm_decotemplate\page\ switch\languages.phtml to become:

PHP Code:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php 
if(count($this->getStores())>1): ?>    
<ul id="select-language" class="languages">
<?php foreach ($this->getStores() as $_lang): ?>
    <li>
        <a href="<?php echo $_lang->getCurrentUrl() ?>">
        <span><?php echo $this->htmlEscape($_lang->getName()) ?></span>
        </a>
    </li>
<?php endforeach; ?>
</ul>
<?php endif; ?>


-- The last one: plz open app\design\frontend\default\jm_decotemplate\catal ognavigationtop.phtml

then add this code:

PHP Code:

<li>
            <a href="<?php echo $this->getUrl('#'?>" title="language Switcher" onmouseover="toggleMenu(this,1)" onmouseout="toggleMenu(this,0)"><span><label for="select-language"><?php echo $this->__('Your Language'?>: </label></span></a>
            <?php echo $this->getChildHtml('store_language'?>
        </li>


between line 181 and 182 and to between line 207 and 208 (before the close tag "</ul>")

Hope this helps you .

#1
Profile photo of Emanuelle Rabier 0.00 $tone December 14, 2010
Public

HI thangnn1510,
Thanks for your helps, need precision for the app\design\frontend\default\jm_decotemplate\catal ognavigationtop.phtml
Need help to fill the red space.
# : ?
your language : ok
store-language : ?
If I need 3 or 4 languages, should I add 4 times the same code ?
regards

#2
Profile photo of thangnn1510 0.00 $tone December 14, 2010
Public

Hi Elenuma!

You don’t need change anything in:

PHP Code:

<li>
            <a href="<?php echo $this->getUrl('#'?>" title="language Switcher" onmouseover="toggleMenu(this,1)" onmouseout="toggleMenu(this,0)"><span><label for="select-language"><?php echo $this->__('Your Language'?>: </label></span></a>
            <?php echo $this->getChildHtml('store_language'?>
        </li>


The code will generate a menu with multi language. So you shouldn’t add many times for the same code.

Hope this helps you .

#3
Profile photo of thangnn1510 0.00 $tone December 15, 2010
Public

Hi Ellenuma!

You could change many things. To put country flags to your deco theme is very easy. Please do the following (this will helps you to add flags to the topbeside my account, wistlist… menu):

-- Open: app\design\frontend\default\jm_deco\layout\catalog .xml then add this line:

HTML Code:

<block type="page/switch" name="store_flag" as="store_flag" template="page/switch/flags.phtml"/>

to between this:

HTML Code:

<block type="page/html_header" name="header" as="header">
....
</block>

-- Open header.phtml in app/design/frontend/default/jm_deco/template/page/html then add this code:

PHP Code:

<?php echo $this->getChildHtml('store_flag'?>


to between this:

HTML Code:

<div class="shop-access">
...
</div>

-- Open: app/design/frontend/default/jm_deco/template/page/switch/flags.phtml then change the code inside to become:

PHP Code:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php 
if(count($this->getStores())>1): ?>
<div class="language-switcher">
    <label for="select-language"><?php echo $this->__('Your Language'?>: </label>
    <?php foreach ($this->getStores() as $_lang): ?>
        <a href="<?php echo $_lang->getCurrentUrl() ?>"><img src="<?php echo $this->getSkinUrl('images/flag_'.$_lang->getCode().'.gif'?>" alt="<?php echo $this->htmlEscape($_lang->getName()) ?>" title="<?php echo $this->htmlEscape($_lang->getName()) ?>" /></a>
    <?php endforeach; ?>
</div>
<?php endif; ?>


-- The last but important step : plz put your flags images into skin/frontend/default/jm_deco/images/. Names of images have this structure: flag_[code].gif

Example: flag_default.gif, flag_de.gif, flag_fr.gif.

Hope this helps you.

#5
Profile photo of Emanuelle Rabier 0.00 $tone December 16, 2010
Public

Many thanks,
Nevertheless could you double check the file app\design\frontend\default\jm_deco\layout\catalog .xml
I verify everywhere but can’t find the code in this file <block type="page/html_header" name="header" as="header">
….
</block>
Could you help me.
Have a nice day

#6
Profile photo of thangnn1510 0.00 $tone December 17, 2010
Public

Many thanks,
Nevertheless could you double check the file app\design\frontend\default\jm_deco\layout\catalog .xml
I verify everywhere but can’t find the code in this file <block type="page/html_header" name="header" as="header">
….
</block>
Could you help me.
Have a nice day

I’m very sorry for this mistake, it is: app\design\frontend\default\jm_deco\layout\page.xm l.

Hope this helps and sorry again .

#7

Please login or Register to Submit Answer

Written By

Comments