Holly
Holly

Reputation: 7752

Magento Translations in template files

I'm working on the footer template of a Magento app for a site that will be available in several languages.

I'm concerned how translations will work if I use simple mark up. For instance:

<span>Payment Accepted</span>
<img src="<?php echo $this->getSkinUrl('images/visa-logo.png');?>" alt="visa logo"/>

I've seen <?php echo $this->__('Some Text'); ?> quite often throughout the Magento template files, is this used for translations? If it is how does it work?

The <?php echo $this->__('Some Text'); ?> is often wrapped within a <span class="label"> tag too.

Alternatively, would I be better using a static block & effecting the translation change on the admin panel, with the different store views available for static blocks?

Upvotes: 0

Views: 908

Answers (1)

Thorsten
Thorsten

Reputation: 186

You are right. <?php echo $this->__('Some Text'); ?> is used for translations. The translate method grabs the translation from the appropriate module csv file or from the theme's translate.csv or the database (inline translation).

A good overview can be found here: https://stackoverflow.com/a/10047702/3670130

Upvotes: 0

Related Questions