Magento – Translatable text to insert / My translation in P or HTML and PHP

Many things in Magento can be quickly and easily translate to customize each and translate.csv (On u.a. 1 , 2 , 3). Of course, it is easiest, if the words to be translated / Texts are already installed so in the code, that only the principle “Translation”,”Translation” can proceed.

But if you want your text to an HTML file or add PHTML, such as e.g.. in den callouts left_col.phtml oder right_col.phtml, it is not enough input from the text, that it is displayed in the frontend. It must be initiated for the proper function of a PHP activity.

There is a need

<?php echo $this->__('To be translated text')?>

be present. Say the php must be present, to activate the translate.
What stood still: It's easier to do it consistently and always to write the English text and then translate it into German translate.csv than the other way.

An example code from the price.phtml about. Line 166 Theme for the price with VAT Show:

<span class=”regular-price” id=”product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>”><?php echo Mage::helper(&#8216;core&#8217;)->currency($_price,true,true)?></span><br><?php echo $this->__(&#8216;incl. tax, excl. ‘)?><a href=/bree_versand target=’_blank’><?php echo $this->__(&#8216;Shipping&#8217;)?></a>

Whether this is the best option now, I do not know, But it works in Firefox and in IE (9).

Used in Magento versions 1.4.1.1 and 1.4.1.0

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

Leave a Reply

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