-
Notifications
You must be signed in to change notification settings - Fork 39
feat(formatjs): support additional src folders #650
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
feat(formatjs): support additional src folders #650
Conversation
Thanks for the pull request, @igobranco! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Enhance the `fedx-scripts.js` script on `formatjs` with an option to extract translations on additional source folders. `--include=plugins --include=plugins2`
8c4b01f
to
fa1a01a
Compare
FYI @OmarIthawi |
This approach seems like a reasonable way to add additional directories to extract, but I am curious about the motivation behind this. I'm mostly wondering why the |
@brian-smith-tcril |
That sounds good to me! Thanks! |
Thanks @igobranco and sorry for keeping you jumping between PRs. This is the nature of opensource contribution in opensource projects, but I with a bit of effort we'll get this improvement for everyone and it'll be a happy moment when we get your PR merged. As a long time contributor, I face this issue almost for all non-trivial changes. So I appreciate you pushing through this contribution. Thanks for @brian-smith-tcril for the review :) |
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.
It looks good to me. However, I haven't tested it and my Node.js skills are a bit rusty.
I recommend having another one like @brian-smith-tcril or whoever is maintaing this repository to review it.
Thanks @igobranco
Allow to extract messages to be translated on .ts files.
@OmarIthawi @brian-smith-tcril I've added a new commit to this PR, with the @brian-smith-tcril suggestion. The increase of extracted translations is big on both authoring and learning MFEs, but on learner-dashboard it don't extract any more more strings. Running the command before and after the change: npm run i18n_extract && grep '"id"' temp/babel-plugin-formatjs/Default.messages.json | wc -l
I tested on 3 repositories and it works, at least don't crash! |
That was my decision, and I don't remember if it was necessary for technical reasons or not. But I think the main motivation was this: if the plugins are in the |
Thanks for providing that context @bradenmacdonald! With that in mind, are you happy with the syntax this PR adds? I think |
I agree it seems reasonable. But maybe we can add a comment to state what our one and only use case is at the moment so that in the future we can remove this if we no longer need it. |
A comment about the use case sounds great! @igobranco would you mind adding a comment mentioning the |
Document the only reason why it was added the --include option on the formatjs in fedx-script.js. The intention use case is to allow extraction from the 'plugins' directory on 'frontend-app-authoring'.
Added a new commit with that comment. |
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.
👍
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.
Thanks a lot for figuring this out!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #650 +/- ##
=============================
=============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🎉 This PR is included in version 14.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Enhance the
fedx-scripts.js
script onformatjs
with an option to extract translations on additional source folders.Example:
--include=plugins --include=plugins2
This PR is required to fix the extraction process on the https://github.com/openedx/frontend-app-authoring/ because there are an additional
plugins
source folder.Then the next step is to change the
i18n_extract
on package.json to include the additional folder on https://github.com/openedx/frontend-app-authoring/blob/04faf54ad8ca74a288c872f1140eafc0aa4f9763/package.json#L14From:
To:
Additionally it was added a new commit to extract translations from
.ts
files.Additional information
openedx/frontend-app-authoring#1589