Guide for localizing a Wordpress theme using PO files in Text United
Wordpress theme files contain strings that can be translated, including both admin and user sections of a website. By generating .POT or .PO files with those strings, your theme can be translated.
Before you select a theme, look through a theme description and make sure that it is ready for translation. Developers don’t always create translation ready themes, so when you’re buying a premium theme make sure to ask if the theme is translation ready. Most premium themes are.
PO files are mainly used to create localized versions of Wordpress themes. POT files usually contain all text strings used in theme files.
Developers use special tools, such as gettext, to run PHP source analysis and create POT file containing all text elements to be translated.
POT file created by theme developers is used as a start point for theme localization. Usually, translation-ready themes contain POT, PO and MO files in language folder of a theme. Depending on the theme, POT file can be provided with a number of PO and MO files, and README.TXT instruction for translators.
Upload your files to Text United and translate in the desired language. You can select someone from your team/yourself to do the translation or use Text United translation services.
After the translated files are generated, upload them to language folder of your theme.
From your FTP client, locate the the wp-config.php file in the directory for your WordPress installation. Open the file in a text editor and find this line:
You will need to change this line to include the translation you just uploaded to WordPress.
define ('WPLANG', 'de_AT');
This line specifies German (Austria), so you’ll need to replace de_AT with your language and country code.
If you’re not familiar with the codes for your native language and country you can head over to the GNU website, where they have all the codes for Language and Country. Remember, if you use the wrong naming convention WordPress won’t be able to use your translation, so double-check if necessary.