0

Hi everyone this may be silly, I want to know if it's possible to add a widget into a variable I made.

{{translate fr='' en=''}}

This is the variable. Quiet simple admin can translate static block with multiple language in only 1 static block and this is what I need. ( I can't do multiple static block for each language )

Now my question is : how can i do this :

{{translate fr='{{widget type="catalog/category_widget_link" anchor_text="À propos" title="À propos" template="catalog/category/widget/link/link_block.phtml" id_path="category/9"}}' en='{{widget type="catalog/category_widget_link" anchor_text="About us" title="About us" template="catalog/category/widget/link/link_block.phtml" id_path="category/9"}}'}}

As you can see what I'm trying to do is to have translate the widget. But it's get confuse by the {{ }}. And I end up with this :

{{widget type="catalog/category_widget_link" anchor_text="À propos" title="À propos" template="catalog/category/widget/link/link_block.phtml" id_path="category/9"' en='About us '}}

In the view instead of À propos / About us.

This is the translate function :

public function translateDirective($construction)
{

    $params = $this->_getIncludeParameters($construction[2]);
    Mage::log(print_r($params, 1), null, 'logfile.log');
    if($store_code = Mage::app()->getStore()->getCode() == 'default' || $store_code = Mage::app()->getStore()->getCode() == 'english_canada') $words = $params['en'];
    else if($store_code = Mage::app()->getStore()->getCode() == 'french') $words = $params['fr'];

    //return $words;
    return $words;

} 

Any help would be really appreciated

Thx in advance!

Sebastien B.
  • 476
  • 3
  • 10

1 Answers1

0

Ok so I found a work around that work for me instead of using a widget to link the category/page I would use a link. It's a bit less user friendly but i can deal with it like so :

<li><a title="{{translate en="Term & Conditions" fr="Terme & Conditions"}}" href="{{store url="customer-service"}}">{{translate en="Term &amp; Conditions" fr="Terme &amp; Conditions"}}</a></li>
Sebastien B.
  • 476
  • 3
  • 10