Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:

Latest Feed, Activity and some other BuddyPress pages show all languages in one go without separation between the langauegs

Solution:

There is a workaround that can be used but it will be a temporary one and it seems that it breaks the pagination but it works as a temporary solution:

// Filter the activity feed by the language:
// 1. buffer the activity entry output...
add_action('bp_before_activity_entry', function () {
    ob_start();
});
// 2. clean the output if the activity is the post activity and languages don't match,
//    flush otherwise.
add_action('bp_after_activity_entry', function () {
    $get_lang = $_GET['lang'];
    $language_code = get_activity_post_language_code();
    if ( $language_code && $get_lang && $language_code !== $get_lang ) {
        ob_end_clean();
    } else {
        ob_end_flush();
    }
});
 
function get_activity_post_language_code() {
    if ( ! bp_get_activity_secondary_item_id() ) {
        return false;
    }
 
    $language_details = apply_filters( 'wpml_post_language_details', NULL, bp_get_activity_secondary_item_id() );
    if ( ! $language_details ) {
        return false;
    }
 
    return $language_details['language_code'];
}

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 17 replies, has 2 voices.

Last updated by Christopher Amirian 11 months ago.

Assisted by: Christopher Amirian.

Author Posts
March 4, 2024 at 1:28 pm #15369808

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

ok If I understood correctly, I need to create a forum topic which I did and called it Test 1 and it shows in the topic page here:

hidden link

It did not show in the Spanish version yet, as I did not translate it. Then I translated it to Spanish, after that it showed correctly on the Spanish forum:

hidden link

I did not click the repair tool at all. So I could not replicate this on the clean installation.

You have mentioned that you did, so it seems I still miss something.

I'd appreciate it if you can create a video on the issue that you replicated on the clean installation using loom:

hidden link

That way at least I can see what you do in the installation to replicate the issue.

Thank you.

March 4, 2024 at 7:19 pm #15371818
ronnyK-4

Not really sure what you did.

I kinda refreshed it.

on original english you see the topic:
hidden link

in the spanish translation its missing:
hidden link

same goes for the Topic Archive:

hidden link No Topic there, but it exists in the Admin Dashboard.

Check it out, run the tool and then it will be there in the spanish versions.

New threads created by Christopher Amirian and linked to this one are listed below:

https://wpml.org/forums/topic/split-translated-discussion-loses-the-forum-assignment-in-buddyboss/

March 5, 2024 at 2:50 pm #15375150

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

Thank you very much. Now I understood the issue and I reported this to the compatibility team.

As this is separate from the original issue, I created a new ticket for it and will get back to you there.

Thanks.