-
Notifications
You must be signed in to change notification settings - Fork 146
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 translations loading before the init
hook
#2866
Conversation
Hey, Changes looks good! Can you please update the PR Summary highlighting the changes in behaviour before and after this PR. |
This looks like it moves some stuff around |
_load_textdomain_just_in_time
noticeinit
hook
I have updated the PR description and the code style in the changeset was updated. |
945d406
to
80ad6b8
Compare
@vahidkay-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@vahidkay-meta merged this pull request in 351a8e3. |
Summary: ### Changes proposed in this Pull Request: The plugin's admin page properties contained strings being translated and these were called before the `init` hook causing the following notice to be logged: ``` Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the facebook-for-woocommerce domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/public_html/wp-includes/functions.php on line 6114 ``` This changeset moves the admin pages' properties into the `init` hook so we follow the proper way of handling translations. More information about the issue: https://make.wordpress.org/core/2024/10/21/i18n-improvements-6-7/#Enhanced-support-for-only-using-PHP-translation-files. ### Screenshots:  ### Detailed test instructions: To recreate the issue, please follow these steps: 1. Enable `WP_DEBUG` and either show the errors on page or in the debug log. 2. Switch the site to a different language, e.g. French. 3. You should see the notice at the top of the admin page (like in the screenshot above) or in the debug log. Pull Request resolved: #2866 Reviewed By: akpurifb Differential Revision: D69531576 Pulled By: vahidkay-meta fbshipit-source-id: 08e497ceb404d0fd7c284aad7d4cfc235ff5b41b
Summary: ## Changelog: * Add - FB product video field to add videos. Also added products sync to support the video field with Batch API by gurtejrehal in #2874 * Tweak - tests for #2874 by gurtejrehal in #2888 * Tweak - tests for Product Update action as ramp up task by nealweiMeta in #2883 * Fix - translations loading before the init hook by iodic in #2866 * Fix - Fixed feeds by requesting a feed file upload session after feed file is generated and added missing new fields to the feed file by mshymon in #2841 Pull Request resolved: #2891 Reviewed By: akpurifb Differential Revision: D69836863 Pulled By: vahidkay-meta fbshipit-source-id: 32408ab4b42f60f921bd599ed982933017185b5e
Changes proposed in this Pull Request:
The plugin's admin page properties contained strings being translated and these were called before the
init
hook causing the following notice to be logged:This changeset moves the admin pages' properties into the
init
hook so we follow the proper way of handling translations.More information about the issue: https://make.wordpress.org/core/2024/10/21/i18n-improvements-6-7/#Enhanced-support-for-only-using-PHP-translation-files.
Screenshots:
Detailed test instructions:
To recreate the issue, please follow these steps:
WP_DEBUG
and either show the errors on page or in the debug log.