


However, if you want to translate your theme you now have to edit the default.po file to add your translations and save it for use. If you are selling the theme or giving away the theme for free you can simply include the default. Click on the “keywords” tab and enter _ and _e for the keywords (these were used in step 2 to localize the theme)ĥ. mo files in a “lang” folder in my theme so my base bath is. Change regular textĢ. Enter a Name for your project info (the name of your theme is fine)ģ. Click on the “paths” tab and enter the path for the files that needs translating. Instead of “naked strings”… Some string' ?> Instead of using echo functions for showing text… You will do this by changing all the text used in the theme to functions so the translation tools know what text to replace for translation. The next step is to edit your theme files to change all your text strings into functions. '/lang' ) ī. Change the term ‘framework’ to whatever you want, it can be the name of your theme, just make sure to keep it as 1 word to avoid any issues.Ĭ. Change the Template path to the location where you will store your. pt_BR.mo)” – see the codex.Ī. So add the following function to functions.php: load_theme_textdomain( 'framework', get_template_directory(). The first step is to include a function into your functions.php file which will search your theme directory for “for the locale.mo and load it (where locale is the current language, i.e. Step 1: Include The load_theme_textdomain Function
