Php 翻译成magento形式

Php 翻译成magento形式,php,magento,csv,locale,Php,Magento,Csv,Locale,我正在翻译一份复习表。表单中有一些在Mage_Review.csv中预定义的短语。 到目前为止没有问题。但是有两个词“综合”和“质量”在评论表中,我在Mage_review.csv中找不到它们的英文来源。我甚至在Mage_Rating.csv里面搜索过。 这是form.phtml内容。请看一看: <div class="form-add"> <h2><?php echo $this->__('Write Your Own Review') ?></

我正在翻译一份复习表。表单中有一些在Mage_Review.csv中预定义的短语。 到目前为止没有问题。但是有两个词“综合”和“质量”在评论表中,我在Mage_review.csv中找不到它们的英文来源。我甚至在Mage_Rating.csv里面搜索过。 这是form.phtml内容。请看一看:

<div class="form-add">
<h2><?php echo $this->__('Write Your Own Review') ?></h2>
<?php if ($this->getAllowWriteReviewFlag()): ?>
<form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
    <fieldset>
        <?php echo $this->getChildHtml('form_fields_before')?>
        <h3><?php echo $this->__("You're reviewing:"); ?> <span><?php echo $this->htmlEscape($this->getProductInfo()->getName()) ?></span></h3>
         <ul class="form-list">
                <li>
                    <label for="nickname_field" class="required"><em>*</em><?php echo $this->__('Nickname') ?></label>
                    <div class="input-box">
                        <input type="text" name="nickname" id="nickname_field" class="input-text required-entry" value="<?php echo $this->htmlEscape($data->getNickname()) ?>" />
                    </div>
                </li>
                <li>
                    <label for="summary_field" class="required"><em>*</em><?php echo $this->__('Summary of Your Review') ?></label>
                    <div class="input-box">
                        <input type="text" name="title" id="summary_field" class="input-text required-entry" value="<?php echo $this->htmlEscape($data->getTitle()) ?>" />
                    </div>
                </li>
                <li>
                    <label for="review_field" class="required"><em>*</em><?php echo $this->__('Review') ?></label>
                    <div class="input-box">
                        <textarea name="detail" id="review_field" cols="5" rows="3" class="required-entry"><?php echo $this->htmlEscape($data->getDetail()) ?></textarea>
                    </div>
                </li>
            </ul>
        <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
            <h4><?php echo $this->__('How do you rate this product?') ?> <em class="required">*</em></h4>
            <span id="input-message-box"></span>
            <table class="data-table" id="product-review-table">
                <col />
                <col width="1" />
                <col width="1" />
                <col width="1" />
                <col width="1" />
                <col width="1" />
                <thead>
                    <tr>
                        <th>&nbsp;</th>
                        <th><span class="nobr"><?php echo $this->__('1 star') ?></span></th>
                        <th><span class="nobr"><?php echo $this->__('2 stars') ?></span></th>
                        <th><span class="nobr"><?php echo $this->__('3 stars') ?></span></th>
                        <th><span class="nobr"><?php echo $this->__('4 stars') ?></span></th>
                        <th><span class="nobr"><?php echo $this->__('5 stars') ?></span></th>
                    </tr>
                </thead>
                <tbody>
                <?php foreach ($this->getRatings() as $_rating): ?>
                    <tr>
                        <th><?php echo $this->escapeHtml($_rating->getRatingCode()) ?></th>
                    <?php foreach ($_rating->getOptions() as $_option): ?>
                        <td class="value"><input type="radio" name="ratings[<?php echo $_rating->getId() ?>]" id="<?php echo $this->escapeHtml($_rating->getRatingCode()) ?>_<?php echo $_option->getValue() ?>" value="<?php echo $_option->getId() ?>" class="radio" /></td>
                    <?php endforeach; ?>
                    </tr>
                <?php endforeach; ?>
                </tbody>
            </table>
            <input type="hidden" name="validate_rating" class="validate-rating" value="" />
            <script type="text/javascript">decorateTable('product-review-table')</script>
        <?php endif; ?>

        </fieldset>
        <div class="buttons-set">
            <button type="submit" title="<?php echo $this->__('Submit Review') ?>" class="button"><span><span><?php echo $this->__('Submit Review') ?></span></span></button>
        </div>
</form>
<script type="text/javascript">
//<![CDATA[
    var dataForm = new VarienForm('review-form');
    Validation.addAllThese(
    [
           ['validate-rating', '<?php echo $this->__('Please select one of each of the ratings above') ?>', function(v) {
                var trs = $('product-review-table').select('tr');
                var inputs;
                var error = 1;

                for( var j=0; j < trs.length; j++ ) {
                    var tr = trs[j];
                    if( j > 0 ) {
                        inputs = tr.select('input');

                        for( i in inputs ) {
                            if( inputs[i].checked == true ) {
                                error = 0;
                            }
                        }

                        if( error == 1 ) {
                            return false;
                        } else {
                            error = 1;
                        }
                    }
                }
                return true;
            }]
    ]
    );
//]]>
</script>
<?php else: ?>
<p class="review-nologged" id="review-form">
    <?php echo $this->__('Only registered users can write reviews. Please, <a href="%s">log in</a> or <a href="%s">register</a>', $this->getLoginLink(), Mage::helper('customer')->getRegisterUrl()) ?>
</p>
<?php endif ?>

您可以在目录>评论和评级>管理评级中翻译评级标签

您可以在目录>评论和评级>管理评级中翻译评级标签

Sergey说的是正确的。您可以在那里进行翻译,但如果您想通过翻译文件进行翻译,则必须修复Magento的review from template中的一个小错误。审阅表单模板中的标签不会通过翻译模块传递

查找此模板:

app/design/frontend/[yourtheme]/[yourskin]/template/review/form.phtml

在第58行Magento 1.9中,您将发现以下代码:

<th><?php echo $this->escapeHtml($_rating->getRatingCode()) ?></th>
您必须向代码中添加翻译解析器$this->,如下所示:

<th><?php echo $this->__($this->escapeHtml($_rating->getRatingCode())) ?></th>

完成此操作后,您将能够通过翻译文件翻译标签

谢尔盖所说的是正确的。您可以在那里进行翻译,但如果您想通过翻译文件进行翻译,则必须修复Magento的review from template中的一个小错误。审阅表单模板中的标签不会通过翻译模块传递

查找此模板:

app/design/frontend/[yourtheme]/[yourskin]/template/review/form.phtml

在第58行Magento 1.9中,您将发现以下代码:

<th><?php echo $this->escapeHtml($_rating->getRatingCode()) ?></th>
您必须向代码中添加翻译解析器$this->,如下所示:

<th><?php echo $this->__($this->escapeHtml($_rating->getRatingCode())) ?></th>
完成此操作后,您将能够通过翻译文件翻译标签