BuddyPress Activity Plus
Textdomain fix for translation (5 posts)

  1. Jacob Schweitzer
    Posted 4 years ago #

    The plugin textdomain is not loaded properly and thus leaves the plugin un-able to be translated. I've implemented a fix, so anyone trying to use another language with this plugin can do so.

    In bpfb.php in lines 32-52 many variables are declared to make the proper textdomain and plugin folder locations, however it doesn't work in the latest version of WordPress. The simplest fix I found is to bypass the variable declarations and just change line 53 to be in the proper format like so :

    load_plugin_textdomain( 'bpfb', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );

    Please update your plugin to reflect proper WordPress textdomain declarations. Thank you.


  2. Santaclaes
    Posted 3 years ago #

    I'm strugglin to fix this problem. I followed your instructions and deleted:

    $textdomain_handler('bpfb', false, BPFB_PLUGIN_SELF_DIRNAME . '/languages/');

    and replaced it with:

    load_plugin_textdomain( 'bpfb', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );

    It still doesn't fix the problem for me, trying to translate in to swedish...

    Any idea where to go from here?

  3. Jacob Schweitzer
    Posted 3 years ago #

    You'll need to put a language file in that directory /languages/ for your language. I usually use the plugin called 'codestyling localization' for making the .po and .mo files. There is multiple ways to do this but I've found this way to be the easiest for me.

  4. Jajtyler
    Posted 3 years ago #

    I tried the same here, but it did not solve the problem for me. I changed the code and added the language files, but nothing happened. Anyone have any suggestions?

  5. Jacob Schweitzer
    Posted 3 years ago #

    The site should be setup properly for your language using something like this in your wp-config.php file:

    define('WPLANG', 'sv_SE');

    That example would set Swedish language for the site. If you need more specifics about this, check here - http://codex.wordpress.org/WordPress_in_Your_Language

    I only made this small fix for this plugin, assuming that the site was otherwise successfully setup for your language already. There are a number of possible common problems including corrupt language files (I suggest using the codestyling localization plugin), the site not being in the same language as the language files you are trying to use, and improper naming of language files (codestyling localization wouldn't allow this).

    Good luck guys.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BuddyPress Activity Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic