WordPress.org

Forums

Simple Image Widget
[resolved] Can't add new translation (5 posts)

  1. katazina
    Member
    Posted 1 year ago #

    I found what's causing the problem.

    In the simple-image-widget.php, line 64
    you forgot to put a / before the 'languages/'

    this is how it should be:
    load_plugin_textdomain( 'simple-image-widget', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );

    Apart from that, thanks the plugin.

    http://wordpress.org/plugins/simple-image-widget/

  2. Brady Vercher
    Member
    Plugin Author

    Posted 1 year ago #

    Hi katazina,

    Thanks for letting me know about the issue. I've updated the code on GitHub. Let me know if this looks like it'll help and I can release it here as well.

    Cheers,
    Brady

  3. katazina
    Member
    Posted 1 year ago #

    Hi,

    modify the load_textdomain line to this:
    load_textdomain( 'simple-image-widget', WP_LANG_DIR . '/simple-image-widget/simple-image-widget-' . $locale . '.mo' );

    I don't know why, but it needs the plugin name and the "-"
    If it is in, then it will be working.

  4. Brady Vercher
    Member
    Plugin Author

    Posted 1 year ago #

    If you're using the version from GitHub, just change the name of your translation file to remove the plugin name and dash and everything will work.

    While testing, I realized that the widget was loading before the text domain, so the name and description weren't being filtered. The latest update fixes that issue as well.

    - Brady

  5. katazina
    Member
    Posted 1 year ago #

    Sorry for the late answer, it's ok :) Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple Image Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.