Translating a plugin/theme using a POT file is another method of translation in WordPress. I have an article where I showed the way of translating the Dokan plugin using another WordPress plugin named Loco Translate. If you want to know the method, you can read the article by clicking here.
Anyways, in this article, I will focus on translating the Dokan plugin (as I did in my previous translation article) into the French Language, but this method will work for any themes/plugins in WordPress.
Downloading POT files
In the first stage, the pot files need to download. For those plugins which are available in the WordPress.org repository, the pot file download link list can be found from the Development tab screen.
Therefore, to download the POT file for the Dokan Lite (Free) plugin, visit the WordPress.org plugin repository, search for the plugin and visit it. Then navigate to the Development tab and click on the Translate part, as shown in the screenshot.
From the list, choose the desired language and download Portable Object Message Catalog (.po/.pot) and Machine Object Message Catalog (.mo) files.
Usually, any premium plugins are not hosted in the WordPress.org repository. So, those plugins translation files are also not available in that repository. However, those plugins POT files can be found by reaching their support.
For the Dokan Pro plugin, the files can be found through this link.
Remaining POT files
Once the files are downloaded, rename them with the text-domain
and country locale code. Dokan Lite (Free) plugin’s text-domain is dokan-lite
, and any premium version of the Dokan plugin’s text-domain is dokan.
Also, for the French language, the country locale code is fr_FR. The complete locale code list can be found through this link.
Uploading POT files
After renaming POT files, they need to upload them to the proper directory. WordPress recommends placing the translation files into the languages/plugins
folder under wp-content
. The full path would be wp-content/languages/plugins/my-plugin-fr_FR.mo
.
See the changes
The translation part is done by completing the above tasks. Now, it is time to see the changes. To do that, change the Site Language from the WordPress Admin Dashboard > Settings > General screen.
Great 👍 Your plugin/theme is now translated in your desired language.
If the article was helpful to you, please leave a comment 🙌