Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter kal123

    (@kal123)

    Fix Replace in “bbp-style-pack/bbp-style-pack.php”

    function bbp_style_pack_init() {
    unload_textdomain( ‘bbpress’ );
    load_plugin_textdomain(‘bbp-style-pack’, false, basename( dirname( FILE ) ) . ‘/languages’ );
    load_plugin_textdomain(‘bbpress’, false, ‘bbpress/languages’ );
    //load the plugin stuff
    bsp_load_plugin() ;
    }

    with:

    function bbp_style_pack_init() {
    unload_textdomain( ‘bbpress’ );
    //load the plugin stuff
    bsp_load_plugin() ;
    }

    add_action(‘init’, function()
    {
    load_plugin_textdomain(‘bbp-style-pack’, false, ‘/languages/’);
    });

    Plugin Author Robin W

    (@robin-w)

    I am not seeing this error on my test site under style pack version 6.1.6 – is this the version you are using?

    I freely confess that text domains are not a strength of mine, and this area was written by a friend who now is no longer available.

    The original idea was that it unloaded bbpress, loaded style pack and then reloaded bbpress to ensure that some foreign translations worked, I cannot entirely remember why.

    your new code has bbpress domain unloaded as before, but at the init stage only style pack is reloaded, the line

    load_plugin_textdomain(‘bbpress’, false, ‘bbpress/languages’ );

    is not added to the init function

    Is your knowledge of text domains good enough that you are confident that your code will work in all circumstances and do you understand why any of this is needed?

    Any help you can give would be appreciated

    Thread Starter kal123

    (@kal123)

    More likely to happen when running Woocommerce 9.4 with WP 6.7:

    The official Woocommerce notice about this change:

    https://developer.woocommerce.com/2024/11/11/developer-advisory-translation-loading-changes-in-wordpress-6-7/

    I am running:

    WooCommerce Version 9.5.1

    bbp style pack Version 6.1.6

    bbPress Version 2.6.11

    I also modified bbpress to move the text domain to an add action that happens later:

    includes/core/actions.php

    add_action( ‘after_setup_theme’, ‘bbp_load_textdomain’, 4);

    And, removed it from bbpress.php core actions to prevent the same issue.

    I am not sure these are the most ideal solutions, as I am not the author of these plugins.

    Plugin Author Robin W

    (@robin-w)

    Thanks for the various bits of info, much appreciated.

    I am continuing to test the various scenarios to ensure changes are robust.

    In the meantime I have released a new version of the plugin to resolve other issues, so if you have made changes to my plugin these will disappear on updating

    Plugin Author Robin W

    (@robin-w)

    Results of further testing :

    You solution produces an issue for sites working in other languages where the bbpress translations do not get loaded. It is almost certainly a fault of my code and my lack of knowledge, and I totally agree that translations should be loaded at init.

    With the versions you state above, I cannot reproduce your error, and without being able to do that, I am reluctant to alter my code at the moment.

    BUT I will revisit if I get further issues reported.

    Thread Starter kal123

    (@kal123)

    The bbpress plugin needs to fix it as well, since your plugin is depending on that code in bbpress.php.

    I have created a bug here for bbpress:

    https://bbpress.trac.www.ads-software.com/ticket/3621

    You can test it with my fix for the bbpress plugin to see if once bppress fixes it, your fix will be sufficient.

    Just comment out the one line in bbpress.php and add the once action I have in the bug to test your fix.

    Then, when bbpress fixes it, you can put out your fix as well.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.