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.
a) Download, install or update Poedit. You can download the software from here.
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!
Hi there,
I use both pot, po and mo files of genesis and envy Pro and translate some words in blog but it can not change as below:
Leave a Comment (Edit)
Filed Under:
Tagged With:
Read more
Leave a Reply
Logged in as
Comment
I also installed Genesis Translation Plugin but both of them not work. Please guide me in detail how to translate these manual.
Thanks,
Hi Tran
It’s the Genesis framework which is not being translated. Which plugin are you using for localisation (other than Genesis Translation)?