-
Notifications
You must be signed in to change notification settings - Fork 58
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 makepot script using wp-i18n makepot #750
Conversation
Note for future: I see Gutenberg has similar labels, but they say "Move up" and "Move down". Perhaps we could reuse those. |
Yeah good idea, let's start the conversation here in the meantime 👍
Concerning |
Actually we are using similar language in a future version of stats which allows a repositioning of blocks:
In this case I would even consider simplifying:
|
Ok I updated the strings, now we only have I feel we should still keep this |
@koke not a priority but if you have some time to review this :) |
"wp": "php -d memory_limit=512M bin/wp-cli.phar", | ||
"premakepot": "yarn makepot:gutenberg", | ||
"makepot": "bash -c \"xgettext -f <( find . -path './src/*.js' ! -path 'node_modules' -print ) --from-code=UTF-8 -k__ -k_n -k_x -k_nx -x ./gutenberg.pot -o ./gutenberg-mobile.pot\"", | ||
"makepot:gutenberg": "yarn clean:gutenberg && yarn wp i18n make-pot ./gutenberg --ignore-domain gutenberg.pot", |
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.
Why is the clean:gutenberg
needed?
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.
Because we want to avoid having source paths in the pot file for build
and build-module
files. I have tried to exclude those using the make-pot
command but it's not very flexible so I'm not sure it's possible to do it cleanly.
Should we add some check to make sure xgettext is present and give a better error message if not? Is it worth mentioning in the README? |
Well in theory we could use Let's add a better error message though 👍 |
Address #751
#658 was a first attempt at fixing the mobile pot file generation.
Since then
babel-plugin-makepot
was removed from gutenberg and the official way is to usewp i18n make-pot
instead. This PR updates our makepot script to use this.Testing Instructions
xgettext
installedyarn makepot
./gutenberg.pot
andgutenberg-mobile.pot
file were generated in the root foldergutenberg-mobile.pot
should only contain the 4 following strings:ADD BLOCK HERE
Move block up
Move block down
Remove content
All other strings in
./src
are already part ofgutenberg.pot
.In a followup PR, we'll want to remove those 4 strings from this repository so all strings from this project are translated by the glopress gutenberg project