In this guide, I will show you how easy it is to translate the frontend of your custom Magento Extension.
While building your extension you should format the text in your template files that you would want to be easily translated like this.
<?php echo $this->__('yourtext');?>
If you need to use strings in classes or blocks you can do it like this.
<?php echo Mage::helper('yourextension')->__('yourtext');?>
Now that you have your template files formatted, you can easily allow your customers to change the text with a custom translation file. Next, we need to declare our translation file.
Place this inside your etc/config.xml file.
<config> <frontend> <translate> <modules> <Your_Extension> <files> <default>Your_Extension.csv</default> </files> </Your_Extension> </modules> </translate> </frontend> </config>
Finally, create a file called Your_extension.csv and add it inside locale/en_US and any other language folders you want to translate.
Next, you can open this file and begin translation. The file will look and work like this.
"Your Text","Change Text To This" "Keep Same Text","Keep Same Text"
In the above translation, you can see how this works. The first set of text will match the text in your Magento template files. The second bit of text can change the text on the frontend.
If you found this helpful please take the time to comment!