worldwideloha.blogg.se

Translate theme poedit
Translate theme poedit





translate theme poedit
  1. #Translate theme poedit for free
  2. #Translate theme poedit how to
  3. #Translate theme poedit code

pot file which is the core translation template. mo files to translate a theme or plugin, and they are generated from the. If you have done everything correctly your site should now show the translated strings you created in step 4 on your site by locating and substituting the default strings in your theme.Instead of translating the theme via Loco Translate which is a user-friendly way to translate or edit the theme strings, you can also manually translate the theme by translating the. Simply go to Settings > General and change the “ Site Language” option. mo file created in part “b” needs to go into your theme’s lang folder (or wherever you defined in step 1 of the tutorial). See the complete list of language codes and country codes to find your exact locale.Įxample File Translated To Portuguese: pt_BR.poĪnd as shown in the example, when you save it will automatically create both the. So, the Brazilian Portuguese file would be called pt_BR.mo.

translate theme poedit

#Translate theme poedit code

pt for Portuguese) followed by the country code (e.g. The naming convention is based on the language code (e.g. po file using a specific naming convention. To translate the default.po file all you have to do is open it in Poedit and enter your translations for each value (click on a string of text and enter the translation below like shown in the image). 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.

#Translate theme poedit for free

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. Click on the “paths” tab and enter the path for the files that needs translating. Enter a Name for your project info (the name of your theme is fine)ģ. Instead of “naked strings”… Some string' ?>

translate theme poedit

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.

translate theme poedit

Change the Template path to the location where you will store your. 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.Ĭ. 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 locale.mo and load it (where locale is the current language, i.e. Step 1: Include The load_theme_textdomain Function

#Translate theme poedit how to

The easiest way to learn how to localize your theme is probably watching the video guide below. It took me several tutorials to finally get it right and I hope I can explain it in the easiest way possible here, so you can get it done right from the start. mo files and the appropriate code necessary for translation.īelow I have highlighted the various steps required to localize and then translate your WordPress theme. It’s actually a very easy process (although time consuming) and it will allow people from all over the globe to enjoy your theme in their native language.Īt this point people actually expect all Premium WordPress Themes to be localized and ready for translation. As a WordPress theme developer it’s best practice to localize your themes so they are ready for easy translation.







Translate theme poedit