4

I got a problem with Magento translation in my translate.csv, because it does not work. It should be easy as all tutorials saying.

I had download the package/module translation put into \app\locale\xx_XX folder and create own translate.csv file in *

\app\design\frontend\[theme]\default\locale\xx_XX

folder.

Some word get the translation was giving priority to the module .csv not to my translate.csv. I cleared all cache files but to no avail.

For instance:

module Mage_Customer.csv: “Fax”,"Faks"
translate.csv: “Fax”,"Fax"

Problem: In the customer account page, it always displayed “Faks” instead of “Fax” which is not I expected.

Did I miss out something? Fyi, im using magento vers 1.7.0.2 CE.

Thank you in advance.

Manoj Deswal
  • 5,785
  • 25
  • 27
  • 50
Leongelis
  • 585
  • 8
  • 21

2 Answers2

11

I found this old topic, and later found a solution: when the same string exists in multiple module translation files, then Magento will scope it, by default with '::'. So you also have to create separate translation strings for all those scopes in your translation.csv

"Mage_Customer::Fax","Fax"
"Mage_Checkout::Fax","Fax"

And for all the other modules in which "Fax" appears (and you care to translate differently).

tzunghaor
  • 211
  • 2
  • 4
1

Please Make Sure You display Value at account page using

<?php echo $this->__("Fax"); ?>

if you write in above code then It will definitely translate.

sv3n
  • 11,657
  • 7
  • 40
  • 73
Keyul Shah
  • 7,219
  • 12
  • 37
  • 60
  • I did not touched the core code. That part of code you mentioned was there under \app\design\frontend\base\default\template\customer\address\edit.phtml (line 64). I got to know this file after enabled the path hints. – Leongelis Dec 23 '13 at 09:59
  • In Translate.csv you write wrong code. try

    translate.csv: 'Fax','Fax'

    – Keyul Shah Dec 23 '13 at 10:14
  • I have tried for "Fax","Fax" and 'Fax','Fax' but still no luck. – Leongelis Dec 23 '13 at 10:29
  • make sure that you are changed in proper file because suppose you are changing in fr_Fr and you write in code en_EN translate.csv. – Keyul Shah Dec 23 '13 at 11:08
  • Sorry, just off from office. Some words are working fine with this translate.csv. This file saved under app\design\frontend[theme][sub-theme]\locale\id_ID\ – Leongelis Dec 23 '13 at 12:16
  • Apologize, please ignore previous saving directory. The modified translate.csv was saved under \app\design\frontend[theme][sub-theme]\locale\id_ID\ – Leongelis Dec 23 '13 at 16:05
  • hmmmm you got ans right :) – Keyul Shah Dec 23 '13 at 16:21
  • I'm sad to say the problem not fixed yet – Leongelis Dec 24 '13 at 01:34
  • There is some small mistake done by you. Don't lose hope and try to figure out the issue . you are on right track. – Keyul Shah Dec 24 '13 at 02:53
  • Sorry to say, that the mistake is probably done by you, @KeyulShah. Some parts of Magento actually do take the module context into consideration when they suppose to output translations. If you take a look into app/code/core/Mage/Core/Block/Abstract.php you will find a __() method that automatically gets the module of the current block and passes it on to the translator. This is the probably the reason why the other answer is working in this case and yours is not . – func0der Jan 08 '16 at 22:09