Important

You are browsing documentation for version 6.1 of OroCommerce, supported until 2029. Read the documentation for the latest LTS version to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Add Translations to Source Code 

Out-of-the-box, only base English translations (en language code) are loaded from the translation files. As described in translation files, these files are located in the Resources/translations directory of any bundle and the translations directory of the application, e.g., Resources/translations/messages.en.yml, Resources/translations/validators.en.yml, etc.

These translations are compiled in the Symfony translation catalogs, which are sets of PHP files. As a result, these files are cached by OPcache, so getting these translations is fairly quick.

You can download translations for other languages from Crowdin or add them manually in the Back-Office. These translations load from the database into the application cache, which is slower than reading them from the Symfony translation catalogs.

To minimize performance issues, add them to the source code as described below:

  1. Use oro:translation:dump-files to dump translations to the translations directory of the application.

  2. When you have updated the existing translations, use a file comparison tool of your choice to verify the dumped files.

  3. Push the files to the version control system (git).

To rebuild Symfony translation catalogs with new translations and remove them from the database, use the oro:platform:update command.

Note that languages loaded from the dumped files can no longer be managed via Crowdin in the UI; a developer must manage their data instead.