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

Fix "Translation loading for the woocommerce-square domain was triggered too early" error on WP 6.7 #269

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

iamdharmesh
Copy link
Member

@iamdharmesh iamdharmesh commented Jan 13, 2025

All Submissions:

  • Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Will this change require new documentation or changes to existing documentation?

Changes proposed in this Pull Request:

In WordPress 6.7, they changed the way translations are loaded which affects how and when translation strings should be triggered. With this change, any __() code called before the after_setup_theme is considered "too early" and will need to be updated to happen on a later hook. This PR updates code to fix these too-early translation notices.

Closes #258

Steps to test the changes in this Pull Request:

  1. Ensure define( 'WP_DEBUG', true ); is set in wp-config.php.
  2. Update to the latest version of WordPress 6.7.
  3. Navigate to your Edit User Profile page and update the language to something other than "English."
  4. Ensure there are no notices on the WordPress admin screen.

Changelog entry

Fix - Resolved "translation loading was triggered too early" issue in WordPress 6.7.

@dkotter dkotter added the needs: UAT The Issue/PR needs to go through UAT label Jan 13, 2025
@dkotter
Copy link
Contributor

dkotter commented Jan 13, 2025

This can go to UAT once QA passes

@qasumitbagthariya
Copy link
Contributor

@iamdharmesh

Regarding the translation, there are no errors, but I noticed a deprecated error. Can you please check on your end? Is this related to this PR?

image

@qasumitbagthariya
Copy link
Contributor

QA Update: ✅

As discussed with @iamdharmesh, this is not related to this PR and is not blocking it. Therefore, I am approving this PR and create a separate issue.

@qasumitbagthariya qasumitbagthariya requested review from a team and diegocurbelo and removed request for a team January 16, 2025 11:19
@vikrampm1 vikrampm1 modified the milestones: Future Release, 4.8.6 Jan 24, 2025
@vikrampm1 vikrampm1 marked this pull request as ready for review January 24, 2025 16:22
@vikrampm1 vikrampm1 merged commit 2b80ff6 into trunk Jan 24, 2025
11 checks passed
@vikrampm1 vikrampm1 deleted the fix/258 branch January 24, 2025 16:23
@vikrampm1 vikrampm1 mentioned this pull request Feb 7, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: UAT The Issue/PR needs to go through UAT status: e2e tests passing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test Compatibility of WooCommerce Extensions with Translation Loading Changes in WordPress 6.7
5 participants