Translating a ClassicPress plugin with Poedit: Create New Translation Template

ClassicPress PluginsThis 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 (File menu) and select (New…):

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 :

Translation Language

You’ll be returned to the main screen of Poedit where you need to click the Save button on the toolbar:

Poedit showing new template

Select your save location, set your filename (which for a plugin should be the plugin slug and the extension of pot) and click Save:

Save as...

With the template now saved, click the Extract from sources button on the main screen:

Po Edit extract from sources

The Catalogue properties window will open on the Source paths tab. Click the plus button below the Paths window and select Add files…:

Catalogue properties - Source paths

Select the file or files to be included and click Open (you may need to repeat this multiple times to include relevant files):

Open

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:

Catalogue properties - Source keywords

Select the Translation properties tab.

Enter the Project name and version and Language team and then click OK:

Catalogue properties - Translation properties

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:

Poedit

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
What is Internationalization and Localization?
Why is Internationalization and Localization important?
When should a plugin be internationalized?
Internationalizing a ClassicPress plugin: How does internationalization work?
Internationalizing a ClassicPress plugin: What is a Text Domain and how is it specified?
Internationalizing a ClassicPress plugin: Localization functions
Internationalizing a ClassicPress plugin: Which localization functions to use?
Internationalizing a ClassicPress plugin: Localizing a string
Internationalizing a ClassicPress plugin: Don't paramaterize your text domain
Internationalizing a ClassicPress plugin: Localizing a string containing a parameter
Internationalizing a ClassicPress plugin: Localizing a string including plurals
Internationalizing a ClassicPress plugin: Localizing a string including notes for the translator
Internationalizing a ClassicPress plugin: Don't include HTML markup in localization
Internationalizing a ClassicPress plugin: Don't localize URLs
Internationalizing a ClassicPress plugin: Localizing a string including line breaks
Internationalizing a ClassicPress plugin: Load plugin translations
Translating a ClassicPress plugin with Poedit: What is Poedit?
Translating a ClassicPress plugin with Poedit: Download Poedit
Translating a ClassicPress plugin with Poedit: Install Poedit
Translating a ClassicPress plugin with Poedit: Create New Translation Template
Translating a ClassicPress plugin with Poedit: Create Translations
Translating a ClassicPress plugin with GlotPress: What is GlotPress?
Translating a ClassicPress plugin with GlotPress: Download and install GlotPress
Translating a ClassicPress plugin with GlotPress: Creating administrators
Translating a ClassicPress plugin with GlotPress: Create a project
Translating a ClassicPress plugin with GlotPress: Import translation template
Translating a ClassicPress plugin with GlotPress: Import translations
Translating a ClassicPress plugin with GlotPress: Create new translation set
Translating a ClassicPress plugin with GlotPress: Export translations
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.

Your Name

Your Email

Suggested Topic

Suggestion Details

Leave a Reply

Your email address will not be published. Required fields are marked *