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

Prevent early translation loading #7701

Merged
merged 13 commits into from
Nov 6, 2024
Merged

Prevent early translation loading #7701

merged 13 commits into from
Nov 6, 2024

Conversation

m1r0
Copy link
Member

@m1r0 m1r0 commented Nov 1, 2024

Resolves #7696

Proposed Changes

There is a new change in WordPress 6.7 that prevents plugins from loading translations too early, without waiting for more parts of WordPress to be loaded.

This PR fixes all translations that are loaded early while preserving the code logic.

Testing Instructions

  1. Use WordPress 6.7.
  2. Set site language to something other than en_US.
  3. Ensure all translations are installed.
  4. Make sure there are no PHP translation warnings similar to this: PHP Notice: Function _load_textdomain_just_in_time was called incorrectly
  5. Test the plugin and make sure everything works as before.

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Legacy courses (course without blocks) are tested
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

@m1r0 m1r0 self-assigned this Nov 1, 2024
Copy link

github-actions bot commented Nov 1, 2024

Test the previous changes of this PR with WordPress Playground.

@m1r0 m1r0 added this to the 4.24.4 milestone Nov 4, 2024
Copy link

github-actions bot commented Nov 4, 2024

Test the previous changes of this PR with WordPress Playground.

Copy link

github-actions bot commented Nov 4, 2024

Test the previous changes of this PR with WordPress Playground.

Copy link

github-actions bot commented Nov 4, 2024

Test the previous changes of this PR with WordPress Playground.

Copy link

github-actions bot commented Nov 4, 2024

Test the previous changes of this PR with WordPress Playground.

Copy link

github-actions bot commented Nov 4, 2024

Test the previous changes of this PR with WordPress Playground.

@m1r0 m1r0 requested a review from a team November 4, 2024 13:21
@m1r0 m1r0 marked this pull request as ready for review November 4, 2024 13:21
Copy link

github-actions bot commented Nov 4, 2024

Test the previous changes of this PR with WordPress Playground.

Comment on lines +35 to +39
<referencedProperty name="Sensei_PostTypes::$course" />
<referencedProperty name="Sensei_PostTypes::$lesson" />
<referencedProperty name="Sensei_PostTypes::$question" />
<referencedProperty name="Sensei_PostTypes::$quiz" />
<referencedProperty name="Sensei_PostTypes::$messages" />
Copy link
Member Author

Choose a reason for hiding this comment

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

This is needed because the constructor properties are set dynamically.

Copy link
Collaborator

@donnapep donnapep left a comment

Choose a reason for hiding this comment

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

Looks good! Seems we need to do the same thing for Sensei Pro too. I'll log a new issue.

@m1r0 m1r0 merged commit 985136d into trunk Nov 6, 2024
22 checks passed
@m1r0 m1r0 deleted the fix/early-translations branch November 6, 2024 09:48
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.

PHP notice on WordPress 6.7
2 participants