Fix | Refactor class-config to ensure compatibility with translations on WP6.7 #430
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the Complianz plugin to comply with WordPress 6.7’s stricter requirements for translation loading, addressing a "Doing It Wrong" error caused by premature loading of translated strings. The load_plugin_textdomain() function was moved to a dedicated method called at the appropriate lifecycle stage, ensuring proper functionality, and its premature invocation in the hooks() method was removed.
A new load_translated() method centralizes the loading of translation dependencies and executes on the init hook with priority 0 for early initialization.
Modularization was improved with methods for handling common translations, dynamically adding Brazil-specific options, and loading configuration files based on user preferences and regions. Action priorities were adjusted for consistency, ensuring proper sequencing of load_translated(), init(), and load_pages().