The ENVY themes are already geared for translation, and come with an envy.pot or envy-pro.pot file in the /lib/languages/ folder. However, if you make any code customisations to the theme,, you will need to create a new POT file with adjusted file/line references.
There’s a tutorial on WPMU DEV called ‘How to Localize a WordPress Theme and Make it Translation Ready’, which is a fabulous guide to localising a theme. However, some of the instructions are a little dated in relation to Poedit and creating the POT file. So, simply follow the instructions below.
How to Update the Localisation on Your Adjusted ENVY Theme
1) If you have added any text strings to your theme files (functions, templates etc), you’ll need to make them translatable.
a) Wrap standard php strings in a __() function.
<?php echo ‘ <span>This theme rocks!</span> ‘; ?>
then becomes (for the ENVY theme) –
<?php echo ‘ <span>’ . __(‘This theme rocks!’, ‘envy’) . ‘</span> ‘; ?>
b) For regular text or text strings being echoed direct to the browser, use _e() instead.
This theme rocks! //or <?php echo ‘This theme rocks!’; ?>
then becomes (for the ENVY PRO theme)-
<?php _e(‘This theme rocks!’, ‘envy-pro’); ?>
2) Update the envy.pot POT file.
b) Launch Poedit and click File > Open.
c) Locate and select the envy.pot or eny-pro.pot file in your theme’s /lib/languages folder.
d) Click Catalog > Update from Sources
e) Click Save/Replace and overwrite the existing envy.pot or envy-pro.pot file (with same filename).
Congratulations! You’re done. The adjusted theme is again translation ready!