0

The template > checkout > onepage > payment > methods.phtml file outputs the payment method string that is shown in the onepage checkout of Magento 1.9.

It's very weird that this string is not translatable by default:
I changed lines 81 to 87 from this:

<label for="p_method_<?php echo $_code ?>">
        <?php if ( isset($payment_map[$_code]) ) : ?>
            <img src="<?php echo $payment_logos_url . $payment_map[$_code] . $payment_logos_filetype; ?>" alt="<?php echo $title; ?>" /><?php break; ?>
        <?php else : ?>
            <?php echo $this->escapeHtml($title) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?>
        <?php endif; ?>
    </label>

To this:

<label for="p_method_<?php echo $_code ?>">
        <?php if ( isset($payment_map[$_code]) ) : ?>
            <img src="<?php echo $payment_logos_url . $payment_map[$_code] . $payment_logos_filetype; ?>" alt="<?php echo $title; ?>" /><?php break; ?>
        <?php else : ?>

// changed line
                <?php echo $this->__($this->escapeHtml($title)) ?> <?php echo $this->__($this->getMethodLabelAfterHtml($_method)) ?>

            <?php endif; ?>
        </label>

Is this something that should be default in Magento 1.9? If yes, should I make a pull request in the Magento 1.9 repo (if this is possible)?

1 Answer 1

1

If I had a penny every time I found a bug in Magento... To reply to your question, I don't think this is really an issue. If you check this method, it loads a block object that you can define for a custom payment gateway (I haven't found any for default methods, so it's optional).

The translation would then happen within this block's template, so you only pass on pieces of text, and it doesn't get mixed up with HTML tags

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.