Go through every string and translate it.In this example it would be foodocs-de_DE.po I typically store all my translation files in a sub directory called lang or languages. WordPress uses this file when doing the translations. MO (Machine Object) file – A binary representation of the PO file.Every string listed in the POT will be in the PO file together with it’s correct translation.
Whenever you use a string in your code files, don’t just echo or print them out. Now back to the code… Write Code With Localization In Mind His “sister-post” to this article is particularly inspiring this week and I recommend you check it out. His posts always give great insight into how he found my articles, along with any hurdles he had. Tell your plugin to use your translation files.Īs you may know, Matt is following this tutorial and posting his results on his own blog.Prepare/generate your translation files.Write your code with localization in mind.Read up more about localization in WordPress.This is what you need to do in order to make your plugin translation ready: But it does provide a really easy way for your plugin users to provide their own translation files. But making your plugin ready for translation doesn’t mean you need to do the translations yourself. Why make your plugin translatable, you might ask? Well, to increase your plugin’s target audience by allowing any person, who speaks any language, the ability to understand and use it. WordPress provides us with all the tools (and functions) we need to make our plugins translatable or localizable.