Magento 如何在phtml文件中添加文本内容进行翻译
我需要在.phtml文件中添加文本内容,以便将其翻译为多语言站点 此处的文件位置: 应用程序>设计>前端>默认>(我的主题)>模板>目录>类别>左侧导航phtml选项1Magento 如何在phtml文件中添加文本内容进行翻译,magento,translation,Magento,Translation,我需要在.phtml文件中添加文本内容,以便将其翻译为多语言站点 此处的文件位置: 应用程序>设计>前端>默认>(我的主题)>模板>目录>类别>左侧导航phtml选项1 <?php echo Mage::helper('catalog')->__('Text here');?> 备选案文2 <?php echo $this->__('Text here');?> [编辑] 要在文本中包含链接,请遵循以下模式: <?php echo $this->
<?php echo Mage::helper('catalog')->__('Text here');?>
备选案文2
<?php echo $this->__('Text here');?>
[编辑]要在文本中包含链接,请遵循以下模式:
<?php echo $this->__('some <a href="%s">text here</a>', Mage::getUrl('some/url/here'));
马吕斯,谢谢你的帮助。我更喜欢选择2作为我的解决方案。你说的“在文本内”是什么意思?在你的问题中给出一个例子或添加一个新的例子。我还需要在文本中添加一个链接,我尝试了这种方法,但没有帮助:“lorem ipsum”我也在翻译的引号中添加了相同的文本,但这不起作用。我需要翻译类似的内容(在引号中翻译):“lorem ipsum dolor amet”
"Text here","Translation here"
<?php echo $this->__('some <a href="%s">text here</a>', Mage::getUrl('some/url/here'));
"some <a href=""%s"">text here</a>","translated <a href=""%s"">text here</a>"