Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento 如何在phtml文件中添加文本内容进行翻译_Magento_Translation - Fatal编程技术网

Magento 如何在phtml文件中添加文本内容进行翻译

Magento 如何在phtml文件中添加文本内容进行翻译,magento,translation,Magento,Translation,我需要在.phtml文件中添加文本内容,以便将其翻译为多语言站点 此处的文件位置: 应用程序>设计>前端>默认>(我的主题)>模板>目录>类别>左侧导航phtml选项1 <?php echo Mage::helper('catalog')->__('Text here');?> 备选案文2 <?php echo $this->__('Text here');?> [编辑] 要在文本中包含链接,请遵循以下模式: <?php echo $this->

我需要在.phtml文件中添加文本内容,以便将其翻译为多语言站点

此处的文件位置: 应用程序>设计>前端>默认>(我的主题)>模板>目录>类别>左侧导航phtml

选项1

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