Opened 5 hours ago
Closed 81 minutes ago
#62547 closed defect (bug) (worksforme)
Notice for _load_textdomain_just_in_time despite correct use of init hook
Reported by: | markhowellsmead | Owned by: | swissspidy |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | trunk |
Component: | I18N | Keywords: | |
Focuses: | Cc: |
Description
The notice “Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pt-must-use 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 init action or later.” is being thrown in a private plugin. The call to load_plugin_text_domain is as follows.
function ptMustUseTranslations() { load_plugin_textdomain('pt-must-use', false, __DIR__ . '/languages'); } add_action('init', 'ptMustUseTranslations');
Change History (1)
#1
@
81 minutes ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from assigned to closed
Note: See
TracTickets for help on using
tickets.
This code alone does not trigger this notice.
You are probably calling
__()
somewhere else in your mu-plugin earlier thaninit
. As per https://make.wordpress.org/core/2024/10/21/i18n-improvements-6-7/, tools like Query Monitor are a snippet like the following one can help you pinpoint the exact location: