【问题标题】:Magento missing translationMagento 缺少翻译
【发布时间】:2023-03-03 16:36:01
【问题描述】:

这是一个非常简单的问题:我需要改变什么才能翻译这个??它在某处硬编码吗?内部数据库?

下面的代码创建了这个标签,可以在这个文件app\design\frontend\rwd\default\template\catalog\product\view.phtml@175找到:

<div class="product-collateral toggle-content tabs">
    <?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>
        <dl id="collateral-tabs" class="collateral-tabs">
            <?php foreach ($detailedInfoGroup as $alias => $html):?>
                <dt class="tab"><span><?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?></span></dt>
                <dd class="tab-container">
                    <div class="tab-content"><?php echo $html ?></div>
                </dd>
            <?php endforeach;?>
        </dl>
    <?php endif; ?>
</div>

它不遵循$this-&gt;__('Recurring Profile') 模式。我的app/locale/pt_BR/Mage_Sales.csv 已经拥有"Recurring Profiles","Perfis Recorrentes" 的键/值。

这是在 Magento 1.9 实例中运行的定期配置文件产品的页面。

【问题讨论】:

  • 还要确保模板中的文本包含在本地化调用中
  • @scrowler 模板似乎没有使用本地化调用:/ 有什么建议吗?
  • 包裹在 __('text here')

标签: magento zend-framework magento-1.9


【解决方案1】:

仰望 应用程序/语言环境/pt_BR/Mage_Sales.csv 会有类似的东西 "Recurring Profiles","Perfiles Repetitivos"

如果该文件不存在,请从 app/locale/en_US/Mage_Sales.csv 复制该文件并替换为您想要的翻译。

【讨论】:

  • 感谢您的评论,但您的建议似乎无法解决问题。我在问题中添加了更多的 cmets。
【解决方案2】:

感谢@scrowler。 Magento 缺少正确的本地化方法调用。 app\design\frontend\rwd\default\template\catalog\product\view.phtml@175处的代码应改为:

<div class="product-collateral toggle-content tabs">
    <?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>
        <dl id="collateral-tabs" class="collateral-tabs">
            <?php foreach ($detailedInfoGroup as $alias => $html):?>
                <dt class="tab"><span><?php echo $this->escapeHtml($this->__( $this->getChildData($alias, 'title'))) ?></span></dt>
                <dd class="tab-container">
                    <div class="tab-content"><?php echo $html ?></div>
                </dd>
            <?php endforeach;?>
        </dl>
    <?php endif; ?>
</div>

刚刚添加了 $this-&gt;__(...) 并检查 .csv 文件中的本地化是否正确。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-03-25
    • 2016-12-28
    • 1970-01-01
    • 2013-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多