-
Notifications
You must be signed in to change notification settings - Fork 52
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
Strings from WordPress core's block-library.js are not extracted #255
Comments
If you use the |
Yep!
const getTermsInfo = terms => ({
terms,
...(terms === null || terms === void 0 ? void 0 : terms.reduce((accumulator, term) => { // This is line 28847
const {
mapById,
mapByName,
names
} = accumulator;
mapById[term.id] = term;
mapByName[term.name] = term;
names.push(term.name);
return accumulator;
}, {
mapById: {},
mapByName: {},
names: []
}))
}); |
Just did a quick test in Peast and it seems that the issue seems to be related to the parentheses around the object expression. Oddly enough the following code seems to work: const getTermsInfo = terms => {
return {
terms,
...(terms === null || terms === void 0 ? void 0 : terms.reduce((accumulator, term) => { // This is line 28847
const {
mapById,
mapByName,
names
} = accumulator;
mapById[term.id] = term;
mapByName[term.name] = term;
names.push(term.name);
return accumulator;
}, {
mapById: {},
mapByName: {},
names: []
}))
};
} I filed a bug upstream: mck89/peast#38 |
As a quick fix can we split this very complex expression in smaller chunks, for example: const getTermsInfo = terms => {
const rest = terms === null || ....;
return {
terms,
...rest
};
} |
@ocean90 With the underlying bug now fixed, you could update the Peast dependency in your fork of this package that you're using on dotorg. I assume we'll update the dependency here once there's a new tagged release. |
This was done in ocean90/wp-cli-bundle@47e8927 and deployed to dotorg. The updated POT file does now include the missing block-library strings, see https://i18n.trac.wordpress.org/changeset/623359. |
Awesome, closing this one for now then 👍 |
Bug Report
Describe the current, buggy behavior
First reported on Slack here. The translation project for WordPress 5.8 is missing some strings, particularly from
block-library.js
.Describe how other contributors can replicate this bug
wp i18n make-pot . --ignore-domain
(orphp -d memory_limit=1G $(which wp) i18n make-pot . --ignore-domain
in case of memory limit issues)Describe what you would expect as the correct outcome
The resulting POT file should include "Text settings", "Toggle to show a large initial letter.", "Drop cap" any many more.
Let us know what environment you are running this on
Provide additional context/Screenshots
Might be related to WordPress now using modern JavaScript syntax for these files.
The text was updated successfully, but these errors were encountered: