The Poedit tool searches through PHP files, looking for functions that have specific names, as specified in the Keywords configuration section. It looks through all the files located in the same directory as the catalog itself and in any additional folders specified under the Paths section of the catalog settings. By specifying .. as an additional path, we tell Poedit to look one directory up from the languages folder, where the plugin files are located.
Based on the configuration that we specified, Poedit is able to find all the instances of the __ and _e functions in the plugin code and retrieve the text strings that are set as the first argument to these functions. Once all the strings have been found, Poedit provides a simple interface to provide translations for each string and saves the resulting translation file. Upon saving, Poedit actually creates two files, the portable object file and the machine object file.
The name of the language files is made from two parts: the name of the text domain, ch11hw_hello_world, which was used in all of our calls to the __ and _e functions in the previous recipes, and the target language code, fr_CA, to match the language configuration that we set earlier in this chapter. To support all the variants of the French language that WordPress supports, you can copy the translation files, changing the language code each time in the Poedit catalog configuration, as well as in the file names (ch11hw_hello_world-fr_CA.po and ch11hw_hello_world-fr_BE.po).