Adding the Gettext Domain

At this point, if you haven't already signed up for your Subversion repository, go ahead and do so. You won't have access to the automated tools until you've checked in the first copy of your plugin. If you don't want the plugin to be available to the public until the translation features are done, give the plugin file header a lower version number than the stable version listed in the readme file.

Once you've checked in the first copy of your plugin, log in to Extend and visit your plugin's page. Under the Admin tab, you'll see a list of handy links and two translation sections: Generate POT File and Add Domain to Gettext Calls. Figure 9-17 shows the Admin screen for Next Page.

Figure 9-17. The Next Page Admin screen on Extend

First, you'll add the domain to the gettext calls. If the domain shown is not the one you want to use, replace it in the text field. Then, choose your plugin file from your computer and press Get domainified file. The modified file will be downloaded back to your computer automatically. Save it over the original, and check it in to Subversion. You can leave it in the trunk for now rather than creating a new tag. Each gettext call should now have the domain added as a second argument, as shown in Listing 9-32.

Listing 9-32. A gettext call with the text domain

<?php _e("Exclude pages: ", 'next-page'); ?>

0 0

Post a comment