Skip to content

_load_textdomain_just_in_time was called incorrectly, with solution #2273

@divineproclamation

Description

@divineproclamation

Describe the bug
Hi,

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the buddypress-media domain was triggered too early.

To Reproduce
In the RTMediaUploadTermsAdmin.php (line-number: 40-41) file (buddypress-media/app/admin/RTMediaUploadTermsAdmin.php), you have called your text domain (buddypress-media) on top-level:

$this->upload_terms_message       = esc_html__( 'terms of services.', 'buddypress-media' );
$this->upload_terms_error_message = esc_html__( 'Please check terms of service.', 'buddypress-media' );

Expected behavior
Can you do something like this:

class constructor:

public function __construct() {
    add_action( 'init', array( $this, 'init_translations' ), 5 );

    // rest of the code
}

and then:

public function init_translations() {
	$this->upload_terms_message       = esc_html__( 'terms of services.', 'buddypress-media' );
	$this->upload_terms_error_message = esc_html__( 'Please check terms of service.', 'buddypress-media' );
}

Additional context
This will resolve this php notice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions