-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Scripts: Prevent mangle of translation functions #28231
Conversation
This should ensure that strings are correctly extracted for translation.
Size Change: +150 B (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
Adding the backport label so we don't forget to add this to Core webpack config even if it doesn't seem to be as affected as Gutenberg. |
That's because core doesn't minify the files as heavily like Gutenberg does. See https://build.trac.wordpress.org/browser/branches/5.6/wp-includes/js/dist/i18n.js?marks=1092#L1092 |
Core includes min and non-min as you mentioned. The minified version in core is similarly mangled to |
So I'd say no backporting needed IMO |
Reserve translation functions from mangling. This should ensure that strings are correctly extracted for translation.
Reserve translation functions from mangling. This should ensure that strings are correctly extracted for translation.
Description
In #28221 we discovered that a string in the
i18n
package was not translated and not correctly extracted. It's believed this is related to function name mangling in the build optimization.Translation function names should remain unmangled so that they can be properly extracted and processed for translation by Core tooling.
How has this been tested?
Compare the
isRTL
function declaration in the i18n build asset from this branch with the current release.Current release:
Build from this branch:
The mangled name
i
is not extracted for translation, but the_x
name should be 👍Fixes: #28221
Types of changes
Bug fix: Translation function names should not be mangled.
Checklist: