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,

Bottom Shadow
Comments (4)
  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.

    • eCommerce Development Company

      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.

  2. Very nice post. I just stumbled upon your blog and wished
    to say that I have really enjoyed browsing your blog
    posts. In any case I’ll be subscribing to your rss feed and
    I hope you write again soon!

Leave a Reply

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


× 4 = twenty four

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>


checkout
Follow

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

Join other followers: