Translate text write on layout xml file.


There is sometime we need this translation to translate it globally. I have spend lot of time to find this solution so I thought may someone can save sometime to get rid from this.

Hope someone can take help from this.

and enjoy his time to developed new thing ­čÖé

Here is how translation work for layout file.


<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>

in the above example you have notice that crumbInfo.label crumbInfo.title this is because it label and title is child of crumbInfo so you have to define it using dot(.)

for parent element tab you just need to write┬átranslate=”label title” only here you can write multiple attribute with (Space) separated. It will translate each element.

Now you just need to add translate.csv in you locale folder with you locale code folder.

 

 

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s