0

I'm using below code in my XML and translate it using translate.csv.

But it isn't working can anyone please help me?

<checkout_cart_index translate="label">
    <reference name="breadcrumbs">
        <action method="addCrumb">
            <crumbName>Beregn pris</crumbName>
            <crumbInfo>
                <label>Beregn pris</label>
                <title>Beregn pris</title>
                <link>/beregn-pris</link>
            </crumbInfo>
        </action>
        <action method="addCrumb" translate="label" module="checkout">
            <crumbName>Cart</crumbName>
            <crumbInfo>
                <label>Indkøbskurv</label>
                <title>Indkøbskurv</title>
            </crumbInfo>
        </action>
    </reference>
</checkout_cart_index>
1

Here is the working code.

<checkout_cart_index>
    <reference name="breadcrumbs">
        <action method="addCrumb" translate="crumbInfo.label crumbInfo.title">
            <crumbName>Beregn pris</crumbName>
            <crumbInfo>
                <label>Beregn pris</label>
                <title>Beregn pris</title>
                <link>/beregn-pris</link>
            </crumbInfo>
        </action>
        <action method="addCrumb" translate="crumbInfo.label crumbInfo.title">
            <crumbName>Cart</crumbName>
            <crumbInfo>
                <label>Indkøbskurv</label>
                <title>Indkøbskurv</title>
            </crumbInfo>
        </action>
    </reference>
</checkout_cart_index>
1

How the xml translate works ?

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

Eg: echo Mage::helper('checkout')->__('your string');

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.

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

<checkout_cart_index translate="label" module="checkout"> //i added the module here
        ...
</checkout_cart_index>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.