I tried to translate with the translate.csv
file, but in this case it doesn't work.
I also tried to find the file in "checkout" folder (every file in the folder) but it doesn't contain the word "Discount".
Any suggestion how this can be done?
The following flow chart shows how Magento combines the translations from different sources:
If translating "Discount" doesn't work in translate.csv
, it means that several modules define "Discount" and these module specific translations have precedence over the global definition from the theme.
However, you also can overwrite module specific translations in translate.csv
with the syntax "Namespace_Module::Original","Translated"
In your case, if you search for "Discount" in app/locale
, you will find that it's translated in Mage_Paypal, Mage_Rss and Mage_Sales. If you want to translate it in everywhere, use:
"Mage_Paypal::Discount","..."
"Mage_Rss::Discount","..."
"Mage_Sales::Discount","..."
"Mage_Rss::Discount (%s)","... (%s)"
"Mage_Sales::Discount (%s)","... (%s)"
You can use Fabian's extension to find out where the text comes from: https://github.com/schmengler/TranslationHints
Installing and enabling it shows you where the source of a translation is. Depending on the information from the module, you can then decide where to put your translation.
I'm not sure where exactly is this but we can try these 2 ways:
app/locale/en_US/Mage_Checkout.csv
and app/locale/en_US/Mage_Sales.csv
.admin panel -> System -> Configuration -> ADVANCED -> Developer -> Translate Inline -> Enabled for Frontend : Yes
(don't forget to add your IP in Developer Client Restrictions -> Allowed IPs
).I am supposing you are talking about the totals when checking out where it says "Discount" in the totals? If so, that is in app/code/core/Mage/Sales/Block/Order/Totals.php.
However, the proper way to change this would be to edit the language file You can either use the translate.csv, or if that isn't working try editing this:
app/locale/en_US/Mage_Checkout.csv
and add the following two lines to the bottom:
"Discount (%s)","Your Text (%s)"
"Discount","Your Text"
That will override the text for your.
"Mage_Checkout::Discount","Your Text"
.
Commented
Feb 23, 2015 at 21:43
To translate this specif part of text it should be used the following code in your translate.csv file:
"Mage_Sales::Discount (%s)","... (%s)"
as suggested by mr. #fschmengler
Thanks for all your help end effort.
In Magento 2, for the Cart page you find it as:
"Discount (%1)","<whatever your translation>"
So (%1) is the extra parameter needed.
Hope it helps.