开发者

About translate="label" attribute in Magento, how does it work?

I see in a config.xml file. I know that <template> block and this is the block hold the email template, and translate attribute which is present will be translate in the locale folder. But I don't know what is it exactly, and how does it work?

translate="label", how does it work?

<template>
    <email>        
        <customer_active_account_email_template translate="label" module="customer">
 开发者_Python百科           <label>Active Customer</label>
            <file>customer_active.html</file>
            <type>html</type>
        </customer_active_account_email_template>
    </email>
</template>


When you see translate="label" module="customer", this tells Magento that it should pass the value in the <label> tag through the customer module's data helper's translate method before displaying it to the screen. In over simplified terms

$label_value = (string) $node->label;
echo Mage::helper('customer')->__($label_value);

If the module attribute is not present, the core module is used. You may specify multiple tags to be translated with a space delimited string.

translate="label type"  

As far as I know, this is supported in the System Configuration section, and the layout xml <action> nodes (for translating paramaters) only.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜