Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a plugin to be translated. I have done following tasks:

1. Loaded the TextDomain

$my_td = 'mysignup';
function my_signup_textdomain_init() {
    load_plugin_textdomain( $my_td, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
add_action('plugins_loaded', 'my_signup_textdomain_init');

2. Added language files(po, pot, mo) in wp_plugin_folder\my_signup\languages (for Bengali bn_BD)

  • mysignup.pot
  • mysignup.mo
  • bn_BD.po
  • bn_BD.mo

3. Changed the language code in wp_config.php file

define('WPLANG', 'bn_BD');

But the problem is nothing is changed. I am not sure what I have done wrong.
Now I need to know how can I test everything, whether what I've done is fine, and how can I solve the issue.

share|improve this question
1  
Have you tried Debug Translations? –  toscho Nov 16 '13 at 13:12

2 Answers 2

For plugins using the directory referred to by load_plugin_textdomain, the language files should be named "domain-locale.mo".

So for your case, the filenames should be mysignup-bn_BD.mo.

share|improve this answer
    
thanks. you are slightly right. But i have done another mistake. –  itskawsar Nov 16 '13 at 18:01
up vote 0 down vote accepted

I got my mistakes! I done everything good except 1 thing, textdomain setup.

I forgot that i have set the $my_td variable outside of function. For this reason, my textdomain was missing. So i made the variable global as following:

$my_td = 'mysignup';
function my_signup_textdomain_init() {
    global $my_td;
    load_plugin_textdomain( $my_td, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
add_action('plugins_loaded', 'my_signup_textdomain_init');

Anyway thank for trying to help me.

**Note: mysignup-bn_BD.mo or mysignup.mo both will work. But mysignup-bn_BD.mo is dynamic way.

share|improve this answer

Your Answer

 
discard

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.