Skip to content

Fixes WordPress 6.7 warning about loading translations too early#479

Closed
akirk wants to merge 1 commit intoWordPress:trunkfrom
akirk:delay-translation-loading
Closed

Fixes WordPress 6.7 warning about loading translations too early#479
akirk wants to merge 1 commit intoWordPress:trunkfrom
akirk:delay-translation-loading

Conversation

@akirk
Copy link
Copy Markdown
Member

@akirk akirk commented Nov 18, 2024

Short introduction

Description of what the PR accomplishes

Admittedly, I cannot see a change in behavior, translations are loaded in the user language even without this PR. Still, I believe it is best practice to load the translations through the hook.

This error message is thrown before the PR:

#0 wp-includes/l10n.php(1386): _load_textdomain_just_in_time('health-check')
#1 wp-includes/l10n.php(194): get_translations_for_domain('health-check')
#2 wp-includes/l10n.php(306): translate('File integrity', 'health-check')
#3 wp-content/plugins/health-check/HealthCheck/Tools/class-health-check-files-integrity.php(20): __('File integrity', 'health-check')
#4 wp-content/plugins/health-check/HealthCheck/Tools/class-health-check-files-integrity.php(297): Health_Check_Files_Integrity->__construct()
#5 wp-content/plugins/health-check/health-check.php(72): require_once('wp-content/plugi...')
#6 wp-includes/class-wp-hook.php(324): HealthCheck\{closure}('')
#7 wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#8 wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#9 wp-settings.php(559): do_action('plugins_loaded')
#10 wp-config.php(232): require_once('wp-content/plugi...')
#11 wp-load.php(50): require_once('wp-content/plugi...')
#12 wp-blog-header.php(13): require_once('wp-content/plugi...')
#13 index.php(17): require('wp-content/plugi...')

Copy link
Copy Markdown

@kasparsd kasparsd left a comment

Choose a reason for hiding this comment

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

This looks good! What are the next steps to get this merged in?

@kasparsd
Copy link
Copy Markdown

@Clorith I noticed that you've been doing most of the recent releases. Please let me know if there is anything else needed here to get this merged and released.

Getting an official community plugin comply with the recent core changes would be beneficial to users.

Clorith added a commit that referenced this pull request Dec 30, 2025
…slation are loaded too early after the changes to WordPress 6.7.

Builds on input and suggestions from various contributors and tickets/pull requests.

Props @kasparsd, @akirk, @EvanHerman, @lightningspirit.
Fixes #477.
Closes #478, #479, #488, #492.
@Clorith
Copy link
Copy Markdown
Member

Clorith commented Dec 30, 2025

Fixed in f0f2875

@Clorith Clorith closed this Dec 30, 2025
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.

3 participants