-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
WordPress Plugin Development Cookbook - Third Edition
By :
The final step to plugin translation is to put the code in place to load a translation file. This is done by registering an action hook callback and calling a single function when it gets executed.
You should have already followed the Making admin page code ready for translation and Translating text strings using Poedit recipes to have the proper files required for this recipe. Alternatively, you can get the resulting code (the ch12/ch12-hello-world/ch12-hello-world-v3.php file and the ch12/ch12-hello-world/languages folder) for these recipes from the book's GitHub page. You should rename the file ch12-hello-world-v3.php to ch12-hello-world.php and copy the languages folder next to the renamed file before starting the recipe.
Follow these steps to load the translation file created in the previous recipe:
ch12-hello-world folder of the WordPress plugin directory...