Quick Tip: How to Translate a WordPress Plugin Description

Jérémy Heleine
Jérémy Heleine
Share

If you’ve developed a useful plugin for WordPress, that’s great – but it’s even better if you make your plugin accessible to users speaking other languages.

The good news is that you can easily make your plugin translation ready. That way it will be available in several different languages.

However, there’s a detail which is not always translated by plugin developers: the description of a plugin. In this quick tip, I will cover how you can translate this description.

translate plugin description

Allowing People to Translate Your Plugin’s Description

To make your plugin translation ready, you generate a POT-file. This file contains all the strings you use in your plugin. To translate your plugin in a given language, one can create a PO-file from this a POT-file and then translate each string, one by one.

By default, the POT-file does not only contain the strings you use with specific functions like __() or _e() it contains three additional strings: the name of the plugin, the URL of the plugin’s website, and the description of the plugin.

That means that, by default, contributors can translate this information. There is a problem – these translations are not used unless you indicate to WordPress that they exist.

To do that, go back to the comment that describes your plugin to WordPress. Located in the main file of your plugin, this comment is mandatory and is used by WordPress to know the name of your plugin and other useful information.

In this comment, there are several required pieces of information to provide, but there are also some optional things you can choose to add. In this list of optional information, we find the text domain used by your plugin to be localized, and the path to the folder containing the localization files.

The comment is a list of key / value associations. For example, below is the comment used by previous versions of my plugin WP Photo Sphere.

<?php
/*
Plugin Name: WP Photo Sphere
Plugin URI: http://jeremyheleine.me
Description: A filter that displays 360×180 degree panoramas. Please read the readme file for instructions.
Version: 2.0
Author: Jérémy Heleine
Author URI: http://jeremyheleine.me
License: MIT
*/
?>

The POT file generated for these versions contains the description. However, as there was no mention to the text domain used by WP Photo Sphere in the comment, the translations of the description weren’t used.

Below is a more recent comment I used since there are several versions.

<?php
/*
Plugin Name: WP Photo Sphere
Plugin URI: http://jeremyheleine.me
Description: A filter that displays 360×180 degree panoramas. Please read the readme file for instructions.
Version: 3.6.2
Author: Jérémy Heleine
Author URI: http://jeremyheleine.me
Text Domain: wp-photo-sphere
Domain Path: /lang/
License: MIT
*/
?>

Two new entries can be seen here: Text Domain and Domain Path. The value to indicate in Text Domain is the text domain used by your plugin, the one you load in your plugin with load_plugin_textdomain(). The Domain Path entry must be filled with a path. In this entry, the root is your plugin’s folder. You have to indicate a subdirectory of this folder, the one that contains all the needed MO-files.

If you use these entries, and if translations for the plugin’s description are available in the current language, these translations will be used. If you want, translations for the plugin’s name can also be used (just don’t remove the corresponding entry in the POT-file!). As said above, the plugin’s URL can also be translated. It can be useful if you provide this webpage in several languages, with a parameter in the URL. For instance, you can indicate http://myplugin.com as the default URL for your plugin, and http://myplugin.com/fr as the URL for French users.

Closing Words

WordPress provides all the tools you need to translate your whole plugin, even its name or description. However, as the Text Domain and Domain Path are not required in the plugin’s header comment, they are often forgotten by developers.

Now you can translate the description of your plugin and describe to all users around the world what it does and why it is wonderful!

Frequently Asked Questions (FAQs) about Translating a WordPress Plugin Description

How Can I Translate My WordPress Plugin Description into Multiple Languages?

Translating your WordPress plugin description into multiple languages can be achieved using various translation plugins available on WordPress. These plugins, such as GTranslate and TranslatePress, allow you to translate your plugin description into different languages. You simply need to install the plugin, configure the settings to your preferred languages, and apply the translations to your plugin description.

What Are the Benefits of Translating My WordPress Plugin Description?

Translating your WordPress plugin description into multiple languages can significantly increase your plugin’s visibility and reach. It allows non-English speaking users to understand the functionality of your plugin, thereby increasing the chances of them downloading and using your plugin. It also enhances user experience and satisfaction, which can lead to positive reviews and higher ratings for your plugin.

Can I Use Google Translate to Translate My WordPress Plugin Description?

While Google Translate is a powerful tool for translating text, it may not always provide the most accurate translations for technical terms and phrases commonly used in plugin descriptions. Therefore, it’s recommended to use dedicated WordPress translation plugins or professional translation services to ensure the accuracy and quality of your translations.

How Can I Ensure the Quality of My Translated Plugin Description?

To ensure the quality of your translated plugin description, you can hire professional translators who are native speakers of the target language. They can provide accurate translations and understand the cultural nuances of the language. Additionally, you can use translation plugins that offer professional translation services.

Can I Translate My WordPress Plugin Description Myself?

Yes, you can translate your WordPress plugin description yourself if you are fluent in the target language. However, it’s important to note that translating technical terms and phrases accurately requires a deep understanding of both the source and target languages. Therefore, unless you are confident in your translation skills, it’s recommended to use professional translation services or plugins.

Are There Any Free WordPress Translation Plugins?

Yes, there are several free WordPress translation plugins available, such as GTranslate and TranslatePress. These plugins offer basic translation features that can be sufficient for translating your plugin description. However, for more advanced features and professional translation services, you may need to upgrade to their premium versions.

How Can I Add a Language Switcher to My WordPress Plugin?

Adding a language switcher to your WordPress plugin can be done using translation plugins that offer this feature. You can configure the settings of the plugin to display a language switcher on your plugin page, allowing users to choose their preferred language.

Can I Translate My WordPress Plugin Description into Any Language?

Most WordPress translation plugins support a wide range of languages, allowing you to translate your plugin description into almost any language. However, the availability of certain languages may depend on the specific plugin you are using. Therefore, it’s recommended to check the language support of the plugin before using it for translations.

How Can I Update the Translations of My WordPress Plugin Description?

Updating the translations of your WordPress plugin description can be done through the translation plugin you are using. Most plugins allow you to edit and update the translations directly from the plugin settings. However, if you are using professional translation services, you may need to contact the service provider to update the translations.

Can Translating My WordPress Plugin Description Affect Its Performance?

Translating your WordPress plugin description should not significantly affect the performance of your plugin. However, using a translation plugin can add some additional load to your website, which can slightly affect its performance. Therefore, it’s important to choose a lightweight and optimized translation plugin to minimize any potential performance impact.