Magento (1.7) specifying a path to translate.csv

Magento (1.7) specifying a path to translate.csv

September 18, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento (1.7) specifying a path to translate.csv

Solving Template Translation Issues in Magento (1.7)

In Magento (1.7), managing multiple language websites with separate templates can sometimes lead to translation file conflicts or incorrect path references. When you want all your sites to use the base template files but find that they are not pulling the correct translate.csv files, here’s a step-by-step guide to resolve this issue.

Understanding the Current Setup

Your current setup is well-structured:

/fronteend/base
/fronteend/english
/fronteend/portuguese

Each site has its own set of template files in /frontend/[site]/template, and you switch between sites using code in the URL, such as http://mysite/en/ or http://mysite/pt/.

You have a translation file for each site located at, for example, /frontend/portuguese/[root category]/locale/pt_PT/translate.csv. You use $this->__() in your .phtml files to pull the translations.

The Problem: Incorrect Translation File Path

The issue arises when you try to make all websites use the /frontend/base template files. In this setup, the files pulled from the base templates fail to find the correct translate.csv file for each language site.

For instance, if you’re running a Portuguese site, the base template files should look for a locale/pt_PT/translate.csv file, but they currently aren’t finding it.

Solving the Path Specification Issue

To solve this, you need to modify your Magento configuration and adjust the path references in your base templates. Here are two key steps:

1. Update the Mage::getStoreConfig() Settings

Open app/code/core/Mage/Core/Model/Store.php and find the getCurrentId() method. Modify the local scope settings for each store view to include the correct locale code.

For example, change this line:

'default_scope' => array('website_id' => $store->getWebsiteId(), 'store_id' => 0),

to:

'default_scope' => array(
    'website_id' => $store->getWebsiteId(),
    'store_id' => 0,
    'locale_code' => $this->getLocaleCode()
),

2. Update the Path References in Your Base Templates

In your base template files, ensure that you are using the correct path to reference the translate.csv file.

For example, instead of hard-coding a path:

Mage::helper('core')->__($key);

use a dynamic path based on the current locale:

$locale = Mage::getSingleton('core/locale');
$path = $this->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'locale/' . $locale->getLocaleCode() . '/translate.csv';
Mage::helper('core')->__($key);

Conclusion: Achieving the Desired Template Translation Setup

By following these steps, you should now be able to make all your websites use the /frontend/base template files while correctly referencing the appropriate translate.csv file for each language site.

Remember, it’s essential to thoroughly test your changes across different browsers and platforms to ensure consistency in your multi-language Magento setup.

For more advanced customization tips and best practices, consider exploring our Magento development services. We specialize in creating and optimizing high-performance e-commerce solutions tailored to meet your business needs.

Magento 1 Catalog Themes Configuration

Our network