-
Notifications
You must be signed in to change notification settings - Fork 2k
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
i18n: Switch to POT generation #7152
Conversation
dc906d1
to
e4544de
Compare
@akirk see the related pMz3w-5vb-p2 I don't know of any other hook points than this. |
We'll also need to update our version to pick up the two dependencies we rely on:
|
@deBhal when updating package.json, please run |
We're going to have to update the i18n-calypso version as well, but I'll add another checkbox so I don't forget to do it after that. Thanks for the reminder :) |
To test:
Thanks! |
@@ -37,5 +37,6 @@ env-config.sh | |||
*.db | |||
|
|||
/calypso-strings.php |
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.
Do we need to ignore this anymore?
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.
You're right, I left it in to avoid complaints about left-over calypso-strings.php
but the CircleCI builds are generated fresh anyway.
ea436f0
to
ec531a2
Compare
translate: node_modules $(CLIENT_CONFIG_FILE) | ||
@CALYPSO_ENV=stage $(BUNDLER) | ||
@CALYPSO_ENV=stage $(LIST_ASSETS) | xargs $(I18N_CALYPSO) --format php --output-file ./calypso-strings.php --array-name calypso_i18n_strings | ||
@CALYPSO_ENV=stage $(I18N_CALYPSO) --format pot --output-file ./calypso-strings.pot $(JS_FILES) |
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 I'm trying to follow the old server/bin/list-assets.js
. At the very least, I don't think you need CALYPSO_ENV=stage
here anymore, as this was driving which assets file was loaded in the list-assets
script. What I haven't been able to determine yet is whether those files were generated for the sole purpose of i18n and can be further cleaned up.
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.
Interesting observation, though determining this is possibly outside the scope of this PR.
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.
The assets files are used for looking up bundled script locations by chunk, so they'll need to remain. That being said, there's some change in behavior here then, as previously I18N_CALYPSO
was run on the built scripts, and are now being run on the source files. Is that okay?
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.
Interesting observation, though determining this is possibly outside the scope of this PR.
It's within scope if your changes cause files or logic to become unused 😄
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.
Yeah, that's part of the reason we are doing this. We want to reference the real string location which was not possible when generating from the built scripts.
LGTM 👍 |
- Adapt artifact script - Copy the new .pot file to the translate subdir - Update dependencies and shrinkwrap Remove list-assets
Thanks everyone! |
This is dependent on
Automattic/xgettext-js#11 (merged)andAutomattic/i18n-calypso#13 (merged). It allows us to generate acalypso-strings.pot
that include the real source locations of the strings. For example:Fixes #5172
Side-effects: building
calypso-strings.pot
doesn't depend on webpack anymore so it's much faster standalone.cc @rralian @yoavf