Magento offers a powerful system to translate strings used in templates, e-mails, and other components. There are several locations where you can place translations; they are loaded in the following order:
Magento database (inline translations).
Theme translations located in
<theme>/i18n/<locale>.csv
.Parent theme translations (until no further parent is specified).
Translation packages located in
app/i18n/<locale>
.Module translations located in
<module>/i18n/
.
In this recipe, we will change a translation for the en_US language; if you want, you can add other languages to your theme also.
This recipe will use the theme created in the Creating a new theme recipe of this chapter, but you can apply it to your own custom theme also.
Create your local translations file:
app/design/frontend/Genmato/default/i18n/en_US.csv
"Add to Cart","Buy"
After uploading the file to your Magento installation, refresh the cache:
bin/magento...