-
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: Extract wp/i18n translatable strings #28200
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
akirk
added
[Status] Needs Review
The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
and removed
[Status] In Progress
labels
Nov 2, 2018
tyxla
reviewed
Nov 2, 2018
package.json
Outdated
@@ -267,7 +267,7 @@ | |||
"test-server": "jest -c=test/server/jest.config.js", | |||
"test-server:coverage": "npm run -s test-server -- --coverage", | |||
"test-server:watch": "npm run -s test-server -- --watch", | |||
"translate": "i18n-calypso --format pot --output-file ./calypso-strings.pot -e date \"**/*.js\" \"**/*.jsx\" \"!build/**\" \"!node_modules/**\" \"!public/**\"", | |||
"translate": "i18n-calypso --format pot --output-file ./calypso-strings.pot -k translate,__,_x,_n -e date \"**/*.js\" \"**/*.jsx\" \"!build/**\" \"!node_modules/**\" \"!public/**\"", |
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.
Are we planning to also target _nx()
?
akirk
force-pushed
the
add/i18n-extract-gutenberg-strings
branch
from
November 2, 2018 09:51
ea1d178
to
874b1a0
Compare
tyxla
approved these changes
Nov 2, 2018
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.
🚢
matticbot
removed
the
[Status] Needs Review
The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
label
Nov 2, 2018
akirk
added a commit
that referenced
this pull request
Nov 27, 2018
…he CI (#28842) * Framework: Add @wordpress/babel-plugin-makepot dev dependency * Build: Use makepot Babel plugin to build pot file * Revert "i18n: Extract wp/i18n translatable strings (#28200)" This reverts commit 242414e. * Start with a babel-plugin-i18n-calypso * typo * Try to avoid need for building by using CJS * Extract translate calls to POT * Integrate babel-plugin-makepot * Remove the translate command * Try a new NODE_ENV * set the calypso env * WIP write to different files to see where strings are dropped * Write single files and concat them using msgcat * Make sure msgcat is available on CircleCI * Remove makepot functionality * Move build files into the build directory * Unify POT headers * Improve POT filenames * Incorporate review feedback * typo * Format plugin with prettier * Remove CI related changes * Build POT using the Babel plugin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the Gutenberg-style translatable strings (
__()
,_x()
,_n()
, and_nx()
) to the methods we extract for translation.Testing instructions
Compare with the
npm run translate
without this change to make sure this only adds and not removes strings tocalypso-strings.pot
.You could use
diff
orpodiff
to check this with a sequence of commands like this:(Unfortunately podiff has a bug regarding multiline contexts, so you'll need to use my patched version).