Localization

Translating with .po/.mo files

Language files included are in the Gettext format, which is the standard format used for language files in WordPress. Each plugin contains a .pot (Potable Object Template) file under the languages sub-folder:

  • Directories - wp-content/plugins/directories/languages/directories.pot

  • Directories - Pro - wp-content/plugins/directories-business/languages/directories-business.pot

  • Directories - Frontend - wp-content/plugins/directories-frontend/languages/directories-frontend.pot

  • Directories - Payments - wp-content/plugins/directories-payments/languages/directories-payments.pot

  • Directories - Reviews - wp-content/plugins/directories-reviews/languages/directories-reviews.pot

Translate these files using a software like Poedit (recommended) and save the generated MO (.mo) files under wp-content/languages/plugins. Make sure that you append the lang code of your language to the file name. For example, if you are translating directories.pot into French, save the generated MO file as directories-fr_FR.mo. If you are unsure what lang code is currently used on your site, go to Directories -> System -> System Info, scroll down to the table labelled Wordpress environment and check the value displayed for Locale as shown below:

Note: Some phrases such as labels used for fields, displays, and filters are not translated unless you had your language files ready before activating the plugin. This is because those phrases can be edited from the backend, and it would become a problem if they are overwritten by uploading language files.

Translating with the Say What? plugin

Sometimes if you only need to translate a few number of words or phrases you may not want to create an entire translation file. This is when the Say What? plugin can help.

  1. Install and activate the Say What? plugin.

  2. Go to Tools -> Text Changes.

  3. Create a new Text Change with the following settings:

    • Original string - Enter the word or phrase you are translating.

    • Text domain - Enter the name of the plugin to which the original string belongs, e.g. directories, directories-pro, directories-payments.

    • Text context - Leave it blank which should work in most cases.

    • Replacement string - Enter the text you want to display.

  4. Press the Add button.

results matching ""

    No results matching ""