Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to translate part of an extension? 
 
speedbird1229
Member
 
Total Posts:  31
Joined:  2008-10-12
 

Hi,

I’m trying to translate an extension called FME QuickRFQ. In its files they use strings:

(Mage::helper(’quickrfq’)->__(’Please Give a brief Overview’));

However, they don’t have any locale csv files with their extension. Where should I create this csv so that it would read the necessary lines from there? I tried adding file quickrfq.csv to app/locale/et_EE but that doesn’t work.

Thanks!
George

 
Magento Community Magento Community
Magento Community
Magento Community
 
viakondratiuk
Jr. Member
 
Total Posts:  25
Joined:  2010-05-18
 

You have to create file app/locale/your_current_locale/FME_QuickRFQ.csv. Also you have to check cache.

Also you can enable Inline Translation from backoffice and watch in what scope your phrase.

 
Magento Community Magento Community
Magento Community
Magento Community
 
brobie
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-07-28
 

It creates the file name up in the \"parent\" helper class using the methods below:

/**
     * Translate
     *
     * @return string
     */
    public function __()
    
{
        $args 
func_get_args();
        
$expr = new Mage_Core_Model_Translate_Expr(array_shift($args), $this->_getModuleName());
        
array_unshift($args$expr);
        return 
Mage::app()->getTranslator()->translate($args);
    
}

/**
     * Retrieve helper module name
     *
     * @return string
     */
    protected function _getModuleName()
    
{
        
if (!$this->_moduleName{
            $class 
get_class($this);
            
$this->_moduleName substr($class0strpos($class\'_Helper\'));
        
}
        
return $this->_moduleName;
    
}

...so if your namespace is FME and your module is QuickRFQ and your helper for that module is: FME_QuickRFQ_Helper_Data, then your file should be named FME_QuickRFQ.csv as viakondratiuk said.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kiatng
Enthusiast
 
Total Posts:  875
Joined:  2008-09-03
Kuala Lumpur, Malaysia
 

Make sure the csv file is declared in config.xml

<config
.
.
.
      <
translate>
            <
modules>
                <
packagename_modulename>
                    <
files>
                        <default>
filename.csv</default>
                    </
files>
                </
packagename_modulename>
            </
modules>
        </
translate>
</
config>
 
Magento Community Magento Community
Magento Community
Magento Community
 
alexcunha
Jr. Member
 
Total Posts:  14
Joined:  2011-05-17
 
kiatng - 17 February 2011 09:30 AM

Make sure the csv file is declared in config.xml

<config
.
.
.
      <
translate>
            <
modules>
                <
packagename_modulename>
                    <
files>
                        <default>
filename.csv</default>
                    </
files>
                </
packagename_modulename>
            </
modules>
        </
translate>
</
config>

Hello

Which config.xml are you refering?

I have the same exact situation: translate quick rfq extension.
Have done the translation creating file /app/locale/pt_PT/FME_QuickRFQ.csv
Is that place to put the .csv file?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
alexcunha
Jr. Member
 
Total Posts:  14
Joined:  2011-05-17
 

Hello

Which config.xml are you refering?

I have the same exact situation: translate quick rfq extension.
Have done the translation creating file /app/locale/pt_PT/FME_QuickRFQ.csv
Is that place to put the .csv file?

Thanks

Answering myself:
config.xml is the /app/code/local/FME/Quickrfq/etc/config.xml (for this particulary case of Quickrfq extension
add to config.xml inside <frontend> tag

<translate>
            <
modules>
                <
FME_Quickrfq>
                    <
files>
                        <default>
FME_QuickRFQ.csv</default>
                    </
files>
                </
FME_Quickrfq>
            </
modules>
        </
translate>
csv file put in /app/locale/pt_PT/FME_QuickRFQ.csv
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top