This post is part of the sub-series on Translating a ClassicPress plugin with Poedit which is part of the Translating a ClassicPress plugin with Poedit series.
With Pedit installed we can use it to localise a ClassicPress plugin.
The first to doing this is to create a template. As I am using the free version I cannot use the Translate WordPress theme or plug-in option, so click the (
) and select ( ):When I develop plugins for ClassicPress, I do it using English (US) as the default language, se select English (United States) as the language of the translation for the template and click
You’ll be returned to the main screen of Poedit where you need to click the Save button on the toolbar:
Select your save location, set your filename (which for a plugin should be the plugin slug and the extension of pot) and click Save:
With the template now saved, click the Extract from sources button on the main screen:
The Catalogue properties window will open on the Source paths tab. Click the plus button below the Paths window and select Add files…:
Select the file or files to be included and click Open (you may need to repeat this multiple times to include relevant files):
With the files selected, click the ,em>Sources keywords tab.
Click the plus icon and add the Additional keywords; these are the function names used in your code which contain the text to be localized.
In this example, this is the esc_html__
and esc_html_e
functions:
Select the Translation properties tab.
Enter the Project name and version and Language team and then click OK:
You’ll be returned to the main screen where the extracted strings will be shown.
Click the Save button on the toolbar to save the template:
The saved template file (extension of pot) can be distributed with the plugin allowing people to make their own translations.
Translating a ClassicPress plugin
Translating a ClassicPress plugin with Poedit |
---|
What is Poedit? |
Download Poedit |
Install Poedit |
Create New Translation Template |
Create Translations |
What should we write about next?
If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.