-
Notifications
You must be signed in to change notification settings - Fork 34
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!: remove Transifex calls for OEP-58 | FC-0012 #383
feat!: remove Transifex calls for OEP-58 | FC-0012 #383
Conversation
Thanks for the pull request, @hopewise! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
9ed6a4e
to
480b6d2
Compare
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.
@hopewise Thanks for the work.
Please check the comments regarding the testing error and other required changes.
Makefile
Outdated
# Pulls translations from Transifex. | ||
pull_translations: | ||
tx pull -t -f --mode reviewed --languages=$(transifex_langs) | ||
else | ||
# Experimental: OEP-58 Pulls translations using atlas |
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.
Will be no longer experimental.
# Experimental: OEP-58 Pulls translations using atlas |
Makefile
Outdated
@@ -93,18 +90,12 @@ push_translations: | |||
./node_modules/@edx/reactifex/bash_scripts/put_comments_v3.sh |
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.
Please remove the push_translations
program.
Makefile
Outdated
# Experimental: OEP-58 Pulls translations using atlas | ||
pull_translations: | ||
rm -rf src/i18n/messages | ||
cd src/i18n/ \ | ||
&& atlas pull --filter=$(transifex_langs) translations/studio-frontend/src/i18n/messages:messages | ||
&& atlas pull translations/studio-frontend/src/i18n/messages:messages | ||
$(generate_supported_langs) $(transifex_langs) |
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 problem with this line is that it depends on the transifex_langs
hard-coded variable, which is no longer used.
One solution is to update the src/i18n/scripts/generateSupportedLangs.js
script to generate the list based on the following algorithm:
-
list all files in src/i18n/messages:
studio-frontend $ ls src/i18n/messages | cat ar.json de_DE.json de.json es_419.json ...
-
Use the list of languages from the files, instead of the
process.argv
:languages: languagesString.split(','),
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.
@OmarIthawi fixes got applied, you can check please.
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 @hopewise, I've checked the fixes and it looks good. It appears that we don't have tests for the new changes which I think is important to have.
Would you mind adding tests and fix the failed nodejs_CI tests build as well?
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.
- This pull request needs to be rebased over feat: generate currentlySupportedLangs.jsx dynamically | FC-0012 #389 once the latter is merged.
808af1e
to
1e8859b
Compare
1e8859b
to
38a0f3b
Compare
@itsjeyd @timmc-edx @brian-smith-tcril this pull request is ready for merge. |
2039041
to
9d4ffd1
Compare
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.
@brian-smith-tcril @timmc-edx this is now ready for merge.
Please note that this is a rather arcane frontend that is not a usual MFE, so if something isn't working in production, please revert this PR and ping me for a fix.
@brian-smith-tcril @spencertiberi the CI failure is a post-test issue. Please check the link below and let me know how it can be fixed: |
@OmarIthawi I'm not sure what you mean by a post-test issue. From what I can see the test is failing because it is expecting the generated import './ar.json';
import './fr.json';
import './fr_CA.json';
import './zh_CN.json'; but the generated file doesn't include that. Summary of all failing tests
FAIL src/utils/i18n/scripts/generateSupportedLangs.test.js
● generate with three languages › should generate currentlySupportedLangs.jsx
expect(received).toEqual(expected)
Expected value to equal:
"// This file is generated by the \"generateSupportedLangs.js\" script.
import './ar.json';
import './fr.json';
import './fr_CA.json';
import './zh_CN.json';
import arData from 'react-intl/locale-data/ar';
import frData from 'react-intl/locale-data/fr';
import zhData from 'react-intl/locale-data/zh';
export default {
'ar': arData,
'fr': frData,
'fr-ca': frData,
'zh-cn': zhData,
};
"
Received:
"// This file is generated by the \"generateSupportedLangs.js\" script.
import arData from 'react-intl/locale-data/ar';
import frData from 'react-intl/locale-data/fr';
import zhData from 'react-intl/locale-data/zh';
export default {
'ar': arData,
'fr': frData,
'fr-ca': frData,
'zh-cn': zhData,
};
" |
@brian-smith-tcril that doesn't look right. I'll check why this test has failed. |
9d4ffd1
to
5b04f0c
Compare
5b04f0c
to
46769f8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #383 +/- ##
==========================================
- Coverage 99.18% 99.18% -0.01%
==========================================
Files 75 75
Lines 1713 1711 -2
Branches 416 416
==========================================
- Hits 1699 1697 -2
Misses 14 14 ☔ View full report in Codecov by Sentry. |
@brian-smith-tcril the comment was posted here by mistake. I've fixed the issue anyway. cc: @spencertiberi |
@hopewise 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Breaking change!
This change breaks the Jenkins transifex integration which has been deprecated in favor of the new GitHub Transifex App integration as part of OEP-58.
Changes
tx pull
andtx push
commands from the micro-frontend in favorof the
atlas pull
command..json
files will be committed into the repos.src/i18n/index.js
should export and empty array so themake pull_translations
override it with the dynamic list of languages.OPENEDX_ATLAS_PULL
flag to makeatlas pull
the default.Makefile
targets and other files.Test results
make pull_translations
works as expected.make pull_translations test results
Merge timeline
This should only be merged after Translation Infrastructure update OEP-58 is fully implemented.
The timing announcement will be shared by @brian-smith-tcril on #translations-project-fc-0012 Open edX Slack channel.
Keep this pull request as a draft to prevent accidental merge.
Pre-merge checklist
References
This contribution is part of the FC-0012 project which is sparked by the Translation Infrastructure update OEP-58.
Up-to-date project overview and details are available in the Approach Memo and Technical Discovery: Translations Infrastructure Implementation document.
Join the conversation on Open edX Slack #translations-project-fc-0012.
Check the links above for full information about the overall project.