WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] load_plugin_textdomain not working (11 posts)

  1. hatul
    Member
    Posted 3 years ago #

    I wrote plugin for wordpress. I maked po file and added load_plugin_textdomain('wp-hebdate') to code but the translation not loaded.
    line to example: _e('Number','wp-hebdate')

  2. elfin
    Moderator
    Posted 3 years ago #

  3. hatul
    Member
    Posted 3 years ago #

    I read it of course.
    I I wrote like in the codex but the translation not working.

  4. elfin
    Moderator
    Posted 3 years ago #

    <?php load_plugin_textdomain( 'my-plugin', false, dirname( plugin_basename( __FILE__ ) ) ); ?>

    according to your first post you just used:
    load_plugin_textdomain('wp-hebdate')

  5. hatul
    Member
    Posted 3 years ago #

    thanks, I checked it and it not working.
    I added load_plugin_textdomain('wp-hebdate', false, dirname( plugin_basename( __FILE__ ) ) ); but the srings still in English.

  6. elfin
    Moderator
    Posted 3 years ago #

    have you uploaded the mo file as well as the po file?

  7. hatul
    Member
    Posted 3 years ago #

    Yes, of course.

  8. Mark / t31os
    Moderator
    Posted 3 years ago #

    What's your language file named? Translation files have a specific naming scheme, which differs for plugins and themes...

    If for example you were loading the french translation for the above text domain the name is expected be.. wp-hebdate-fr_FR.mo ...

    Still problems, try the demo plugin i posted on my blog, and see if that helps clear up your understanding.

    http://t31os.wordpress.com/2010/06/09/wordpress-plugin-translation/
    NOTE: Download link is in the third paragraph down, and it's a very basic and bare bones example simply to show how to do simple translation.

  9. hatul
    Member
    Posted 3 years ago #

    The file called simply he_IL.mo

  10. hatul
    Member
    Posted 3 years ago #

    I changed file name to wp-hebdate-he_IL.mo and the tranlation loaded.
    thanks

  11. Mark / t31os
    Moderator
    Posted 3 years ago #

    Happy to help.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic