If you would like to add a translation, you can use the translation template that is included with the plugin.
The included translation templates are found under affiliates-pro/lib/core/languages/affiliates.pot
and affiliates-pro/lib/ext/languages/affiliates-pro.pot
. These can be used with a tool like Poedit to create the necessary translation files for your desired language and region. Import the translation templates with the tool and create your source translation files named affiliates-xx_YY.po
where xx_YY
identifies the locale – xx
represents the language code and YY
represents the region code. You must create one set of files within the plugin’s lib/core/languages
folder using the core template affiliates.pot
and another set in lib/ext/languages
using the additional translations from the template affiliates-pro.pot
.
xx
– represents the language code, for example: en, de, es, pt, …YY
– represents the region code, for example: UK, US, DE, FR, …
When you save your translations, the tool should also create a file named affiliates-xx_YY.mo
– you must place both these files inside the plugin’s folders lib/core/languages
and lib/ext/languages
to make your translations available to your WordPress installation. If you have chosen the correct language code and region code, your translations will be visible as soon as you have added those files. You can find the complete set of locales supported by WordPress here.
Note that some languages use formal and informal translations. For example, when you use a German (de
) translation for use in Germany (DE
), you might want to offer the formal translation instead of the informal one. The informal translation uses the files affiliates-de_DE.po
and affiliates-de_DE.mo
while the formal translation uses affiliates-de_DE_formal.po
and affiliates-de_DE_formal.mo
. There are other variants used depending on region and we already include several of them with the plugin. You can find these in the plugin’s lib/core/languages
folder. Curiously, the formal translation source for German (de
) as spoken in Switzerland (CH
) would be named affiliates-de_CH.po
while the informal translation’s source would be named affiliates-de_CH_informal.po
. These are not particular to the plugin but correspond to the locales that have been chosen for WordPress.
Contributing your Translation
If you would like to contribute your translation to make sure that it is maintained also after updates, please contact us.
Summary of Translation Files
These files are involved in creating and deploying translations …
a) Translation templates (Portable Object Template):
- Core translation template (Portable Object Template):
affiliates/lib/core/languages/affiliates.pot
- Extended translation template (Portable Object Template):
affiliates/lib/ext/languages/affiliates-pro.pot
b) Translation sources and compiled files:
- Core translation source (Portable Object):
affiliates/lib/core/languages/affiliates-xx_YY.po
- Extended translation source (Portable Object):
affiliates/lib/ext/languages/affiliates-xx_YY.po
- Core compiled translation (Machine Object):
affiliates/lib/core/languages/affiliates-xx_YY.mo
- Extended compiled translation (Machine Object):
affiliates/lib/ext/languages/affiliates-xx_YY.mo
Locales are identified by the language code xx
and the region code YY
.
Assuming a standard WordPress folder hierarchy, the translation files are located in wp-content/plugins/affiliates-pro/lib/core/languages
and wp-content/plugins/affiliates-pro/lib/ext/languages
.