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

Marius
  • 197,939
  • 53
  • 422
  • 830

1 Answers1

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!

Fabian Blechschmidt
  • 35,388
  • 8
  • 75
  • 182