3

I need translate the label "browse files" and "upload files" for a extension which uses default uploader of magento.

In Mage_Adminhtml_Block_Media_Uploader i changed the function _prepareLayout()

protected function _prepareLayout()
{
    $this->setChild(
        'browse_button',
        $this->getLayout()->createBlock('adminhtml/widget_button')
            ->addData(array(
                'id'      => $this->_getButtonId('browse'),
                'label'   => Mage::helper('adminhtml')->__('Browse Files...'),
                'type'    => 'button',
                'onclick' => $this->getJsObjectName() . '.browse()'
            ))
    );

    $this->setChild(
        'upload_button',
        $this->getLayout()->createBlock('adminhtml/widget_button')
            ->addData(array(
                'id'      => $this->_getButtonId('upload'),
                'label'   => Mage::helper('adminhtml')->__('Upload Files'),
                'type'    => 'button',
                'onclick' => $this->getJsObjectName() . '.upload()'
            ))
    );

    $this->setChild(
        'delete_button',
        $this->getLayout()->createBlock('adminhtml/widget_button')
            ->addData(array(
                'id'      => '{{id}}-delete',
                'class'   => 'delete',
                'type'    => 'button',
                'label'   => Mage::helper('adminhtml')->__('Remove'),
                'onclick' => $this->getJsObjectName() . '.removeFile(\'{{fileId}}\')'
            ))
    );

    return parent::_prepareLayout();
}

to

protected function _prepareLayout()
{
    $this->setChild(
        'browse_button',
        $this->getLayout()->createBlock('adminhtml/widget_button')
            ->addData(array(
                'id'      => $this->_getButtonId('browse'),
                'label'   => Mage::helper('adminhtml')->__('Buscar Archivos'),
                'type'    => 'button',
                'onclick' => $this->getJsObjectName() . '.browse()'
            ))
    );

    $this->setChild(
        'upload_button',
        $this->getLayout()->createBlock('adminhtml/widget_button')
            ->addData(array(
                'id'      => $this->_getButtonId('upload'),
                'label'   => Mage::helper('adminhtml')->__('Subir Archivos'),
                'type'    => 'button',
                'onclick' => $this->getJsObjectName() . '.upload()'
            ))
    );

    $this->setChild(
        'delete_button',
        $this->getLayout()->createBlock('adminhtml/widget_button')
            ->addData(array(
                'id'      => '{{id}}-delete',
                'class'   => 'delete',
                'type'    => 'button',
                'label'   => Mage::helper('adminhtml')->__('Remove'),
                'onclick' => $this->getJsObjectName() . '.removeFile(\'{{fileId}}\')'
            ))
    );

    return parent::_prepareLayout();
}

file upload

but without results

7
  • Question is not clear. Can you elaborate it more? Why do you need label values? Commented Feb 28, 2014 at 13:03
  • do this in front end or admin panel? Commented Feb 28, 2014 at 13:03
  • You can get label values using jquery/js I think. Commented Feb 28, 2014 at 13:04
  • I changed the Question. I need translate the labels, anything more. Commented Feb 28, 2014 at 13:08
  • yes answer for the question of @MeenakshiSundaramR Commented Feb 28, 2014 at 13:09

1 Answer 1

2

You can't afaik translate the label.

This two buttons are part of the flex uploader. The names of the buttons can be found here: lib/flex/uploader/uploader.mxml and can be changed there. We tried this but didn't achieve our goal, because we ware not able to compile the flex uploader.

Good luck! If you make it, please tell me which Flash/Flex version you used and ow you did it!

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.