Home » Magento tutorial for developer » How to debug translation in Magento

How to debug translation in Magento

How to debug multiple translations in Magento?

When your store is dealing with multiple translations, sometimes you just want to see a list of which translations are coming from what modules. Magento doesn’t offer a way to get this information without editing the core, so what I am about to do should only be done for debugging and then removed.

First, located:

  • File: app/code/core/Mage/Core/Model/Translate.php
  • Class: Mage_Core_Model_Translate
  • Function: translate()

Then, right before the line “return $result;”, put the following snippet of code:

This will, for every request, write a bunch of lines to the translate.log file under /var/log.

The file will looks something like:

After you figure out which module is displaying the translation, remove the lines of code from Mage_Core_Model_Translate and be on your merry way!

About Brian Wilson

avatar
Brian is a freelance Magento developer with 5 years of experience with customizing Magento extensions, magento themes. He's interested in sharing Magento Tutorials to the community

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Scroll To Top