Translate my custom magento module to frontend

I made my own magento module and I want to translate for it.

How can I do this without creating another translation module?

Thank you very much.

+4
source share
1 answer

You can use the built-in translation methods and define all your lines in the templates as follows:

<?php echo $this->__('yourtext'); ?> 

if you need to use strings in classes or blocks, you can get the context from the helper class as follows:

 <?php echo Mage::helper('yourextension')->__('yourtext');?> 

and if you need to define your own translation file, use it in etc / config.xml

 <config> <frontend> <translate> <modules> <Your_Extension> <files> <default>Your_Extension.csv</default> </files> </Your_Extension> </modules> </translate> </frontend> </config> 
+9
source

Source: https://habr.com/ru/post/1348060/


All Articles