2016-08-14 57 views
0

我在Magento中有一個包含文本"All Categories"的公共函數,我如何在Magento中翻譯這個文本。例如,我想如果你的方法是模塊在Mage_CatalogMage_Catalog.csv文件Magento在php中的翻譯文本

public function getCatNameCustom($category){ 
    $level = $category->getLevel(); 
    $html = ''; 
    for($i = 0;$i < $level;$i++){ 
     $html .= ''; 
    } 
    if($level == 1) return $html.' '.$this->__("All Categories"); 
    else return $html.' '.$category->getName(); 
} 

回答

0

翻譯,那麼就可以在Mage_Catalog.csv翻譯。

如果你的方法是,例如模塊CustomDeveloper_CustomModule,然後模塊需要定義它是在config.xml中翻譯文件,然後你可以把你的翻譯中CustomDeveloper_CustomModule.csv(如果它被定義一樣在xml文件中)。