大家好,这可能很愚蠢,我想知道是否可以将小部件添加到我制作的变量中。
{{translate fr='' en=''}}
这是变量。安静的简单管理员可以仅在 1 个静态块中翻译多种语言的静态块,这就是我所需要的。(我不能为每种语言做多个静态块)
现在我的问题是:我该怎么做:
{{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"}}'}}
如您所见,我要做的是翻译小部件。但它被 {{ }} 弄糊涂了。我最终得到了这个:
{{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 '}}
在视图中而不是À 建议/关于我们。
这是translate
功能:
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;
}
任何帮助将非常感激
提前谢谢!