Aimeos uses Gettext for translations. The Gettext format is a widely used industry standard for translating content into all kind of languages and is supported by almost all translation tools. Translations consists of the translation source (.pot file, e.g. "lib-mshop.pot"), the translations for every language (.po files, e.g. "de.po") and the binary machine object file (e.g. "de").
If you want to replace only a few translations, you can easily do that by adding a configuration that will be used instead of the translations from the Gettext files. Please have a look into the articles about overwriting translations for your framework (Laravel, Symfony, etc.) or your application (TYPO3, etc.).
To translate Aimeos to a new language or add missing translations for an existing language, please use the Transifex website instead. Theses translations will be added automatically to Aimeos in the next release.
Sometimes you need to overwrite some more translations because you use specific wording at your web site. Also, if you've created your own extension and classes which contains additional strings to translate, using the Gettext files is a much better approach.
Using Gettext, you can also create country specific translation files, e.g. "de_CH.po" resp. the "de_CH" binary file. If you configure your language in the Aimeos locale to be "de_CH" instead of "de", translations from the "de_CH" file will be used. If no translation is found in the "de_CH" file, the "de" file is used instead.
You need the Gettext utilities (xgettext, msgfmt) for creating the .pot and binary files. In Windows environments, you have to install Cygwin and its Gettext package first.
To replace existing Aimeos core translations in your own extension, you need to follow these steps:
Repeat this for each language you need. There will be binary files without extension in the same directory afterwards. These are the ones that will be used to lookup translations first. If the binary file doesn't contain the translation for the requested string, the Aimeos core file will be used instead.
Strings can only be translated if they are wrapped by one of these methods:
The "domain" argument determines the Gettext domain of the translation. In Aimeos translation domains like "mshop", "client" or "controller/jobs" are used. They correspond to the core and extension directory where the "./i18n/" subdirectory is located at. Translation domains separate translations into different files, so two translation domains can contain the same source string but different translations.
To translate new strings, follow these steps:
For each .po file there should be binary file without extension in the same directory afterwards. These binary files will be used to lookup the translation for the source string.
If the phing utility isn't available, you can also execute the commands (xgettext, msgfmt) yourself.