Magento – how to setup multiple language in magento single store view

magento-1.7magento-1.8magento-enterprise

Now I try to setup multiple language in magento single store view. So, Is it possible in Single Store view?

Because I have created Multiple Store views For Every Vendor. So, Now can I have multiple languages for magento single store view?

Best Answer

You can set Direct Language code

$locale = 'nl_NL';
Mage::getSingleton('core/session')->setMyLang($langCode);
$locale = Mage::getSingleton('core/session')->getMyLang();


Mage::getSingleton('core/translate')->setLocale($locale)->init('frontend', true);

$defaultStore = Mage::app()->getStore()->getCode();
Mage::app()->setCurrentStore($defaultStore);
Mage::app()->getLocale()->setLocale($locale);
Mage::app()->getTranslator()->init('frontend', true);

$defaultLocale = Mage::app()->getLocale()->getLocaleCode();

now Site translate in Your set Language.

Related Topic