-
Notifications
You must be signed in to change notification settings - Fork 799
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
Use the new i18n-loader-webpack-plugin #21936
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
Backup plugin:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @anomiex wonderful job! So excited we could get this resolved so soon.
This works for me and looks good. We might want to test WPCOM before merging, left an inline comment.
wp_register_script( $handle, $payload_url, array(), false, false ); | ||
// Set translation domain to `jetpack`, and we need to explicitly set the `path` to load translations files for WPCOM. | ||
// Otherwise WPCOM would try to load from `WP_LANG_DIR . '/mu-plugins'` and fails. | ||
wp_set_script_translations( $handle, 'jetpack', WP_LANG_DIR . '/plugins' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in WPCOM, the translation path was resolved to mu-plugins
if /plugins
not specified here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be ok since the path now isn't being determined by wpcom PHP code, but testing is a good idea.
Looks like we may have to wait until #21932 is merged first so the TC build on D70962-code will succeed. Or merge this into #21932 then test it with a D70957-code that contains the changes from here too, if reviewers would rather.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it turns out testing this is kind of a pain, because the Fusion patch doesn't include the changes to the Assets package but those are required for it to work.
Once I manually apply those in my sandbox, it almost works. It tries to fetch the right path, but apparently wpcom blocks access to .json
files inside wp-content/languages/
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured it out, and updated the testing instructions so it should be easy for someone else to test it too.
Sigh. So the wpcom stuff isn't happy because D71392-code isn't merged yet, but it can't be due to p3topS-X5-p2 |
Hacked around the wpcom problem, this should be ready for review again. |
Great news! One last step: head over to your WordPress.com diff, D70962-code, and commit it. Thank you! |
r236678-wpcom |
Changes proposed in this Pull Request:
webpack-config: Use
@automattic/i18n-loader-webpack-plugin
Provide the new plugin as part of the standard set of plugins.
jetpack: Use
@automattic/i18n-loader-webpack-plugin
Configure the new plugin and remove the hack Instant Search was using to
work around the problem the plugin was created to fix.
Jetpack product discussion
PT: p9dueE-3MG-p2
Does this pull request change what data or activity we track or use?
No
Testing instructions:
jetpack docker exec /var/scripts/fakepot.sh /var/www/html/wp-content/plugins/jetpack
to generateen_piglatin
anden_rtl
locales.wp-content/mu-plugins/jetpack-packages/production/
andcomposer update automattic/jetpack-assets=1.14.x-dev
to get the new version of the assets package.