How to add translations for new words in Magento?
For this:
<?php echo Mage::helper('catalog')->__('Text here');?>
Add like:
app/locale/{lang_ISO}/Mage_Catalog.csv
"Text here","Translation here"
For this:
<?php echo $this->__('Text here'); ?>
Or this (in theme local.xml
, note the translate
attribute; also see https://stackoverflow.com/a/8408058/794071):
<reference name="top.links">
<action method="addLink" translate="label title">
<label>Text here</label>
<title>Text here</title>
</action>
</reference>
Add like:
app/design/frontend/{interface}/{theme}/locale/{lang_ISO}/translate.csv
"Text here","Translation here"
E.g.: in your theme folder:
/locale/fr_FR/translate.csv
"Inspiration","Your France Translation"
You don't really translate words. You need to translate static blocks, pages, attributes, e-mail templates and configuration related elements from the backend. To translate system strings, there's app/design/frontend/{package}/{theme]/locale/{locale}/translate.csv
{locale} could be for example de_DE for the German language used in Germany.
Modification of translation files at app/locale/{locale}/
is NOT advised as they are part of language packages and should be regarded as core elements that may get overwritten as soon as the package is updated.