How to Translate Client Document Manager or any WordPress Plugin
Smarty Client Document Manager now includes a localization system so you can translate the plugin to your own language using .po files. PO files use gettext function and it is the way that WordPress handles all localization. I will explain a little bit below on how to translate our .po files. This tutorial will also serve as a way to translate any WordPress plugin to your own language!
- First you want to open the smarty plugin directory and find the folder /languages/
- Next you want to download and install PoEdit which is a 3rd party program you will use edit the .po file. Download PoEdit by clicking here.
- Once PoEdit is installed double click on the default.po file and it should open up in PoEdit.
- Now that the po file is open you want to go to File>Save as. The filename is very important, for this plugin you want to start the file with “sp-cdm” and end it with your locale code which can find here. For instance if i were creating a spanish language file I would name the file “sp-cdm-es_ES.po” . Click save and PoEdit will generate two files. a “.po” which is your translation file and a “.mo” which is for WordPress. Your files should look like this:
- Now that you have created your file you can go through and edit your .po file and translate it! To translate a term just click on the term in top section, you will see the actual term in the middle section and you write your translated term in the bottom section. I filled out the first one below.
- Go through each term and translate untill finished. Once complete go to File >Save and you are done!
- The rest is done straight through WordPress wp-config.php file but if your translating this plugin then you know how to do this. Those that do not, just open your wp-config.php and change the
define(‘WPLANG’, ”); To your locale code. For Spanish your WPLANG would look like this: