Primary

Translations

If you would like to add a translation, you can use the translation template that is included with the plugin.

The included translation template is found under affiliates/lib/core/languages/affiliates.pot and can be used with a tool like Poedit to create the necessary translation files for your desired language and region. Import the translation template with the tool and create your source translation file named affiliates-xx_YY.po where xx_YY identifies the localexx represents the language code and YY represents the region code.

  • 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 folder affiliates/lib/core/languages or inside wp-content/languages/plugins 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 affiliates/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:

  • Translation template (Portable Object Template): affiliates/lib/core/languages/affiliates.pot
  • Translation source (Portable Object): affiliates/lib/core/languages/affiliates-xx_YY.po
  • Compiled translation (Machine Object): affiliates/lib/core/languages/affiliates-xx_YY.mo

Locales are identified by the language code xx and the region code YY.