I often get asked if it’s possible to change the labels used by the Participants Database plugin, including the name of the plugin.
This is sometimes called “white labeling” meaning that all traces of the name of the plugin, developer and labels are customized to give the appearance of a custom application.
This is possible because nearly all the text is processed through a translation file which can be edited to “translate” the plugin text to anything you want.
Here’s how to do that
The first step is to install a translation file editor on your computer. I use Poedit on my Mac, but there are several to choose from for different platforms. This article on WordPress.org explains how to do this.
Now, in the plugin, in a directory named “languages” are all the translation files. Using FTP, download the file for your language to your own computer. Make a copy for backup, then open the original in the translation editor.
Finding Your Translation File
To find the translation file to edit, you need to know the language code for your language. If you don’t know the code, check the WordPress Locales page to find it. Once you know the code, the plugin language file will have that code in it. For instance, if your language is Danish, the code is “da_DK” so your language file is
participants-database-da_DK.po. That file will be found in:
Creating a New Translation
If no file exists for your language, you can create a new one in the translation file editor. Start by opening the language template file
participants-database/participants-database.pot in your translation editor to create the new translation. The editor will provide a way to do this. You’ll need to know the correct language code.
Once you’ve opened the translation file in the editor, you can search for the words you want to change. If there is more than one string that matches and you don’t know which one to change, you can check the context of the string, which tells you which script the text is from. That can give you a clue as to where the text is seen. Most of the time, it doesn’t matter, you can just change them all.
Saving your changes
Once you’ve made all your changes, save the file. This will create a new .mo file in the same location as the language file you edited. Now, you’ll need to upload the two files to the plugin to make the change complete: the .po file and the .mo file ( which contains the binary data the plugin uses to generate text) for your language.
For your changes to persist through plugin updates, you need to upload your translation files to the WP languages directory. The plugin will look there first for language files, overriding any language files in the plugin itself. Upload the files to a directory named “participants-database” in the general languages directory. For most WP installs, that will be in this location:
“LOCALE” will be replaced by the current locale value, which identifies the language you are using for your site. This is normally set in the general settings. With that in place, the plugin will use your edited translation files. The locale string will be something like “en_US” (American English), “pt_BR” (Brazilian Portuguese), etc., so if your language is Brazilian Portuguese, the files you will save are:
IMPORTANT: don’t put your translation file into the wp-content/plugins/participants-database plugin folder, it will be lost when you update the plugin.
If you are multilingual and would like to contribute a new (or updated) translation to the plugin, please contact me, I welcome the contribution!