gpt4 book ai didi

php - Magento 1.9 中的电子邮件翻译问题

转载 作者:搜寻专家 更新时间:2023-10-31 21:07:07 24 4
gpt4 key购买 nike

我的翻译有问题。我不明白为什么我的内容在网站上翻译得很好,但在电子邮件中却没有。翻译是在 csv 文件中完成的,但是当我像往常一样调用这个句子时,Magento 得到的是英文翻译而不是法文翻译。

电子邮件/stock.phtml :

    <?php if ($products = $this->getProducts()): ?>
<p><?php echo $this->__('You are receiving this notification because you subscribed to receive alerts when the following products are back in stock:') ?></p>
<table>
<?php foreach ($products as $product): ?>
<tr>
<td><a href="<?php echo $product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($product->getName()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($product, 'thumbnail')->resize(75, 75) ?>" border="0" align="left" height="75" width="75" alt="<?php echo $this->escapeHtml($product->getName()) ?>" /></a></td>
<td>
<p><a href="<?php echo $product->getProductUrl() ?>"><strong><?php echo $this->escapeHtml($product->getName()) ?></strong></a></p>
<?php $shortDescription = $this->_getFilteredProductShortDescription($product) ?>
<?php if ($shortDescription): ?>
<p><small><?php echo $shortDescription ?></small></p>
<?php endif; ?>
<p><?php if ($product->getPrice() != $product->getFinalPrice()): ?>
<?php echo $this->__('Regular Price:') ?> <strong style="text-decoration:line-through;"><?php echo Mage::helper('core')->currency($product->getPrice()) ?></strong><br />
<strong><?php echo $this->__('Special price:') ?> <span style="color:#FF0000;"><?php echo Mage::helper('core')->currency($product->getFinalPrice()) ?></span></strong>
<?php else: ?>
<strong><?php echo $this->__('Price:') ?></strong> <?php echo Mage::helper('core')->currency($product->getPrice()) ?>
<?php endif; ?></p>
<p><small><a href="<?php echo $this->getProductUnsubscribeUrl($product->getId()) ?>"><?php echo $this->__('Click here not to receive alerts for this product') ?></a></small></p>
</td>
</tr>
<?php endforeach; ?>
</table>
<p><a href="<?php echo $this->getUnsubscribeUrl() ?>"><?php echo $this->__('Unsubscribe from all stock alerts') ?></a></p>
<?php endif; ?>

你知道如何告诉 Magento 它必须在我的电子邮件模板中采用法语翻译吗?

最佳答案

要翻译电子邮件,您可以将其从en_US 文件夹复制到相应的语言文件夹(例如es_ES),然后执行翻译。执行此操作时,您还可以在电子邮件中添加或删除其他变量。大多数电子邮件的标题都会显示可用的变量。

至于向电话号码添加国家代码,您需要在模块中定义一个新 block 来为您执行此操作。

link 上还有另一种解决方案

关于php - Magento 1.9 中的电子邮件翻译问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30592037/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com