pot fileġ.) Go to File -> New From POT/PO File and open up your existing. my-theme.pot or my-plugin.pot) and open it with Poedit.Ģ.) In Poedit go to Catalog -> Properties and open the Translation Properties tab.ģ.) Change the Project name and version into something that will suit your projectĥ.) Add more paths into Excluded paths if needed.ħ.) Click Extract from sources (if you don’t have any source text strings yet).Ĩ.) Click Ok (and after this you should see some source texts if your theme/plugin contains any).ġ0.) Your POT file should be now ready to be used for translations. pot file into the lang/ folder in your theme/plugin folder (create that folder if it doesn’t already exist), name it after your text domain (eg.
#Poedit tutorial wordpress manual
Generally I’d recommend you just to download the my-theme.pot file to save yourself from some manual copy/pasting.ġ.) Unzip the and move the.
#Poedit tutorial wordpress how to
If you’d like to learn how to add proper related paths, excludes and sources keywords, just go through the “The “Skip the POT file” option where I’m going to explain how to set up those correctly. It, however, doesn’t give you any default WordPress related paths, excludes or sources keywords, so you’d have to add them manually. Instead of using my ready made pot file you can also use the WP-CLI i18n make-pot command to create POT files for your themes and plugins.
#Poedit tutorial wordpress free
In this article I’m going give you an overview on my theme/plugin localization process with Poedit, which is a free translations editor for po/mo files. Wrapping text strings with _(), _e() and other functions makes a tiny overhead compared to using plain text strings, but you’re going to thank yourself for using them the day your client asks you to make their website multilingual. Making your theme or plugin translateable doesn’t usually take too much of an extra effort, so I usually recommend to make the theme/plugin translation ready right from the start even if you don’t currently plan on translating it.
However you might still want to read through “I18n for WordPress Developers” on WordPress Codex, “Localization” on Theme Handbook and “Localization” on Plugin Handbook to understand how localization works under the hood. I tried to write this article in a way that it contains all the necessary information you might need to make your themes and plugins translation ready.