We saw how to create a new locale file and how to compile a translations file. Now we will see how to upgrade our extension to i18n.
To enable multilingual support in our extension, we have to create a new folder structure for the translation files. We have to open a shell, go to the extension folder, and then create a directory named translations
.
# cd /var/www/packtmediaproject/extension/packtmedia
# mkdir translations
# mkdir translations/ita-IT
# mkdir translations/fra-FR
# mkdir translations/de-DE
For all of the folders, we have to create the translation.ts
file named according to the string that we will use in the templates.
As for the main siteaccess that we configured in Chapter 2, we have to notify the system to also enable the internationalization system for our extension. To do this, we need to open the site.ini.append.php
file located in the extension settings/
directory.
# cd /var/www/packtmediaproject...