Skip to content

Conversation

@NoumaanAhamed
Copy link
Collaborator

@NoumaanAhamed NoumaanAhamed commented Jan 21, 2026

Fixes the issue at #2273

[21-Jan-2026 07:39:04 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>buddypress-media</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /Users/noumaanahamed/Local Sites/godam-rtmedia/app/public/wp-includes/functions.php on line 6131
[21-Jan-2026 07:39:05 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>buddypress-media</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /Users/noumaanahamed/Local Sites/godam-rtmedia/app/public/wp-includes/functions.php on line 6131
[21-Jan-2026 07:39:05 UTC] PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>buddypress-media</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /Users/noumaanahamed/Local Sites/godam-rtmedia/app/public/wp-includes/functions.php on line 6131

This fix ensures translations are loaded at the init action, and will resolve the PHP notice about _load_textdomain_just_in_time being called incorrectly.

Copilot AI review requested due to automatic review settings January 21, 2026 07:14
@rtBot
Copy link
Contributor

rtBot commented Jan 21, 2026

Unable to PHPCS or SVG scan one or more files due to error running PHPCS/SVG scanner:

  • app/admin/RTMediaUploadTermsAdmin.php

The error may be temporary. If the error persists, please contact a human (commit-ID: 4cdafb3).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to fix a translation loading issue by deferring the initialization of translatable strings from the constructor to the init action hook. However, this introduces a critical bug.

Changes:

  • Moved translation string initialization from __construct() to a new init_translations() method hooked to the init action

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NoumaanAhamed NoumaanAhamed changed the title Fix/translations loading Fix: translations loading earlier warning Jan 21, 2026
@NoumaanAhamed NoumaanAhamed requested a review from mi5t4n January 21, 2026 07:52
Copy link
Member

@mi5t4n mi5t4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants