In Chapter 7, we have learned how to use the localization functionalities provided by WordPress. Using the __()
and _e()
functions, we can specify localizable text that users can translate to different languages.
We can split the localization process in two phases.
In the first phase, you need to generate a POT file that will describe all localizable strings used in the plugin.
In the second phase, users generate .po
and .mo
files in their desired language. A PO file is the same as a POT file, but includes translated strings in another language. A MO file is actually a compiled PO file and is loaded by the load_text_domain()
function that we used in the WordPress plugin.
Localization process is usually performed using external tools that are available for Windows, Mac OS or Linux platforms. Example of one such popular multi-platform tool is Poedit, which we will use in this chapter.