WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At the moment i'm developing my first wordpress plugin and want to include multi-language function in it. May be there is some manuals on it? Tried to google, but only get best wordpress language switcher plugin.

share|improve this question

Basically read the source for the function load_plugin_textdomain():

function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false )

Ignore the second parameter, it was deprecated a long time ago.

An example from my plugin T5 Taxonomy Location:

protected function load_language()
        plugin_basename( dirname( __FILE__ ) ) . '/languages'

The first parameter is the text domain, the last the path to the languages directory in the plugin.

Now you can use strings in your plugin with that text domain:

__( 'Locations', 'plugin_t5_tax_location' )

There are multiple tools available to create new translations. I have used Codestyling Localization in the past, but it is broken now unfortunately.

share|improve this answer
What is wrong here: function load_language(){ load_plugin_textdomain('dleToWp', FALSE, dirname(plugin_basename( __FILE__ )).'/languages/'); } add_action('plugins_loaded', 'load_language'); add_management_page(__('Title', 'dleToWp'), __('Convert database', 'dleToWp'), 'manage_options', 'database_convert', array($this, 'settings_page')); wp-content/plugins/dleToWP/languages/ru_RU.mo – user1692333 Dec 31 '12 at 17:08
Maybe the trailing slash? – toscho Dec 31 '12 at 17:12
thanks a lot - problem was in file name. – user1692333 Dec 31 '12 at 17:22
And second question, how do you manage to use protect method? I jus added in to the constructor ` add_action('plugins_loaded', array($this, 'load_language')); ` and it fails – user1692333 Dec 31 '12 at 17:24
I am calling this method in my constructor. See the source code of the plugin. – toscho Dec 31 '12 at 17:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.