15,Jun
2013

Language translation in external page using magento code structure

Language translation in magento

There are many occasions where we need to translate the text in external script or page to our store language which is not in English.

Suppose you want to translate some text in Chinese language then you have to include that text in locale which is zh_cn.

Please check the following code snippet for example.

<?php 
include_once 'app/Mage.php';
umask(0);
Mage::app();
Mage::getSingleton('core/translate')->setLocale('zh_CN')->init('frontend', true);
$test_strting = “test”;
echo Mage::helper('core')->__($test_strting);
?>
									

You have to make sure that you have defined the translation in the CSV file for that particular word. By considering the above example the conversion for “test” word must be in the /app/design/frontend/package/theme/locale/zh_CN/translate.csv

Hope it will help you.

Thanks,

Post by Bhavin

Bottom Shadow
Comments (2)
  1. brittanie7246

    January 16, 2014

    Hey there Swift question that’s thoroughly out topic.
    Have you any idea steps to make a website smartphone helpful? My web site appears to be strange when searching from my telephone.
    I’m looking for a concept or plug-in that could possibly clear up this condition. If you have any suggestions, please share.
    Thanks a lot.

    • Bilal Momin

      February 15, 2014

      Hi Brittanie, Can you be more specific about the crimps your website is facing. Is your website built in Magento? If there is anything I can be of help, you are free to reach me out anytime. We surely can come up with a solution for it.

Leave a Reply

Your email address will not be published. Required fields are marked *


+ four = 12

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


United States, United Kingdom, Australia, Italy, Brazil, Canada, Spain, France, Germany, South Africa, New Zealand, Netherlands, Austria, Switzerland, Estonia, Ireland, Romania, Egypt, Belgium, Algeria, Albania, Belarus, Jamaica.
Follow

Get every new post on this blog delivered to your Inbox.

Join other followers: