Hot File

How to Translate a WordPress Plugin Description

View: 538    Dowload: 0   Comment: 0   Post by: hanhga  
Author: none   Category: WordPress template   Fields: Other

10 point/246 review File has been tested

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.

Introduction

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.

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!

How to Translate a WordPress Plugin Description

How to Translate a WordPress Plugin Description Posted on 10-10-2016  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. 0.040650406504065/10 538

Comment:

To comment you must be logged in members.

Files with category

  • 11 Powerful Tips and Techniques in wordpress

    View: 413    Download: 0   Comment: 0   Author: none  

    11 Powerful Tips and Techniques in wordpress

    Category: WordPress template
    Fields: Other

    0/1 review
    Debugging is an essential skill for any developer. This tutorial will show you 11 powerful ways to debug WordPress and PHP errors.

  • MH Edition Lite Responsive WordPress Theme 2017 Free

    View: 546    Download: 6   Comment: 0   Author: none  

    MH Edition Lite Responsive WordPress Theme 2017 Free

    Category: WordPress template
    Fields: Other

    0/1 review
    MH Edition lite is a flexible and visually sophisticated WordPress theme for technology and news magazines. This magazine theme can transform your current WordPress website into a powerful and yet lightweight online magazine or dynamic news website...

  • Morning Monday Lite Responsive WordPress Theme Free

    View: 518    Download: 7   Comment: 0   Author: none  

    Morning Monday Lite Responsive WordPress Theme Free

    Category: WordPress template
    Fields: Other

    1.5/3 review
    Morning Monday Lite theme is designed for magazine with flexible layout. The theme is based on KOPATHEME layout manager technique that will let you flexibility choose layout options of every pages within your site.

  • How to Translate a WordPress Plugin Description

    View: 538    Download: 0   Comment: 0   Author: none  

    How to Translate a WordPress Plugin Description

    Category: WordPress template
    Fields: Other

    0.020325203252033/246 review
    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.

  • Lovecraft Responsive WordPress Theme Free

    View: 437    Download: 1   Comment: 0   Author: none  

    Lovecraft Responsive WordPress Theme Free

    Category: WordPress template
    Fields: Other

    2/2 review
    Lovecraft is a beautiful two-column theme for bloggers. It features a responsive design, great typography, a full-width header image

  • Ascent Theme is a fully responsive WordPress theme

    View: 5019    Download: 0   Comment: 0   Author: none  

    Ascent Theme is a fully responsive WordPress theme

    Category: WordPress template
    Fields: Other

    4.5/1 review
    Ascent Theme is a fully responsive WordPress theme that looks elegant on any devices. It is simple, clean and lightweight WordPress theme based on the most modern technologies like HTML5 and CSS3.

  • Photolab Responsive WordPress Theme Free

    View: 523    Download: 0   Comment: 0   Author: none  

    Photolab Responsive WordPress Theme Free

    Category: WordPress template
    Fields: Other

    4/1 review
    Photolab theme echoes a flat design approach and a modern clean look perfect for creating an engaging blog. Its layout inspired by the latest trends underlines visual excellence of the theme without distracting from the content.

  • ZeroGravity is a simple and light WordPress theme

    View: 465    Download: 0   Comment: 0   Author: none  

    ZeroGravity is a simple and light WordPress theme

    Category: WordPress template
    Fields: Other

    4.5/1 review
    ZeroGravity is a simple and light WordPress theme with a clear and neat design. Some its features are: left sidebar or right, custom theme color (blue, green, orange, red, pink, yellow or purple), custom favicon, six different Google Fonts,...

 
Newsletter Email

File suggestion for you

File top downloads

logo codetitle
Codetitle.com - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.com Develope by Vinagon .Ltd