0

I've a multilanguages site in Magento 1.9. In return section there's a table and code of its head is the following:

<table class="data-table" id="my-returns-items-table">
                    <col />
                    <col />
                    <col />
                    <col />
                    <col />
                    <col />
                    <col />
                    <col />
                    <thead>
                        <tr>
                            <th><span class="nobr"><?php echo $this->__('Product Name') ?></span></th>
                            <th><?php echo $this->__('SKU') ?></th>
                            <th class="condition"><?php echo $this->__('Condition') ?></th>
                            <th class="resolution"><?php echo $this->__('Resolution') ?></th>
                            <th><span class="nobr"><?php echo $this->__('Request') ?></span></th>
                            <th><?php echo $this->__('Qty') ?></th>
                            <th><?php echo $this->__('Status') ?></th>
                            <th></th>
                        </tr>
                    </thead>

'SKU' translation in the other languages don't shown and I don't know why. I inserted "SKU","Product" into translate.csv but the string that I see is "UGS". This don't happen for other attribute of tale head. Can you help me please?

Thanks!

1 Answer 1

0

Under certain conditions, translation keys need a module prefix.

  1. Add the if-block below to method _getTranslatedString() in app/code/core/Mage/Core/Model/Translate.php.

    protected function _getTranslatedString($text, $code)
    {
        // ADD THIS BLOCK
        if ( $text == 'SKU' )
        {
            Mage::log('Translation key for SKU: '.$code, Zend_Log::DEBUG, 'sql_translation_key.log', true);
        }
    
        $translated = '';
        if (array_key_exists($code, $this->getData())) {
            $translated = $this->_data[$code];
        }
        elseif (array_key_exists($text, $this->getData())) {
            $translated = $this->_data[$text];
        }
        else {
            $translated = $text;
        }
        return $translated;
    }
    
  2. Visit the page in question.

  3. Check contents of var/log/sql_translation_key.log. You should see something like Translation key for SKU: Module_Name::SKU.
  4. Use the latter as the key in your translate.csv so it looks similar to "Module_Name::SKU","Product".
  5. Remove the if-block

Don't forget to disable translation cache while debugging.

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.