![]() If your plugin supports WordPress versions older than 4.6 (you define this with the Requires at least directive in the readme.txt file of the plugin) you should also declare the text domain and the relative path to the translation files with the load_plugin_textdomain() WordPress function. The resulting plugin header with our example-plugin text domain: /* * Plugin Name: Example Plugin * Author: Plugin Author * Text Domain: example-plugin */ An exception for plugins compatible with old WordPress versions After generating the PO file you can rename the file to POT. A pro version of it also features one-click scanning for WordPress plugins. When you include the c you’re telling POEdit the second argument is a comment. The free Poedit default version supports manual scanning of all source code with Gettext functions. The :1,2 extension tells POEdit that these keywords consist of two parts: the second argument is the plural. Enter the following: e n:1,2 x:1,2c ex:1,2c. Its value should match the plugin slug, namely the unique portion of the plugin URL.Īs an example, in a plugin available at the correct value of the text domain is example-plugin. Next, you need to tell POEdit which keywords to look for when scanning your files. More specifically, the text domain is an identifier used by WordPress to categorize the loaded translations. The first step for making your plugin hosted on translatable is to declare the text domain in the plugin header. ![]() Declare the text domain in the plugin header This section will cover the method used to make a plugin hosted on the repository translatable. Make a WordPress plugin hosted on translatable ![]() With a translatable WordPress plugin, you can cover a more extensive user base for your plugin hosted on or sell more licenses in marketplaces like Envato Market. In this tutorial, you will learn how to make a WordPress plugin translatable.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |