Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load our translation domain earlier #7185

Open
wordpressfan opened this issue Dec 12, 2024 · 0 comments
Open

Load our translation domain earlier #7185

wordpressfan opened this issue Dec 12, 2024 · 0 comments

Comments

@wordpressfan
Copy link
Contributor

Describe the bug
Currently we register our translation domain with init action but with priority 10 here
So if we have a plugin that has any translatable strings from our domain before this priority, this will be a problem.

We had a dev escalation this week with this issue and we found that our settings dashboard is showing in English only in all cases.

Then we had a discussion with the team and agreed on changing this priority to be 0 or 1 to cover most of those cases.

To Reproduce
Steps to reproduce the behavior:

  1. Use the following custom code:
add_action( 'init', function () {
    error_log( esc_html__( 'WebP cache is disabled by filter.', 'rocket' ) );
}, 1 );
  1. Change the dashboard language to be French
  2. Visit our dashboard
  3. Check debug.log, you will see the logged message in English

Expected behavior
We should load our translation domain early before any other plugins try to load any of our translatable strings.

Additional context
Slack Discussion: https://wp-media.slack.com/archives/C056ZJMHG0P/p1733743264603399

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

No branches or pull requests

1 participant