Note
We've adopted a convention of overriding translations in the translations
directory.
If you would like to change any of the translation keys defined in Sylius in any desired language.
For example:
- change "Last name" into "Surname"
- change "Add to cart" into "Buy"
There are many other places where you can customize the text content of pages.
Tip
You can browse the full implementation of these examples on this GitHub Pull Request.
In order to customize a translation in your project:
1. If you don't have it yet, create translations/messages.en.yaml
for English translations.
Note
You can create different files for different locales (languages). For example messages.pl.yaml
should hold only Polish translations, as they will be visible when the current locale is PL
. Check the Locales </book/configuration/locales>
docs for more information.
Tip
Don't forget to clear the cache to see your new translations appear: php bin/console cache:clear
.
2. In this file, configure the desired key and give it a translation.
If you would like to change the translation of "Email" into "Username" on the login form you have to override its translation key which is sylius.form.customer.email
.
sylius:
form:
customer:
email: Username
Before
After