Skip to content

fix: include plugins in i18n extraction script #1802

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

Conversation

igobranco
Copy link
Contributor

@igobranco igobranco commented Apr 10, 2025

Description

This PR extract more translations to be translated from the exiting source code, when translated those new strings, it will improve localization.

  1. Upgrades the frontend-build to the v14.5.0, with the support for additional source folders.
  2. Configure the plugins folder to be used as source folder for i18n extraction.

Executing this command before and after this PR, and the prerequisites. You will see an increase of the extracted strings to be translated.

npm run i18n_extract && grep '"id"' temp/babel-plugin-formatjs/Default.messages.json | wc -l

From 1730 before to 2471 after.

Depends on / prerequisites

Any.

  1. feat(formatjs): support additional src folders frontend-build#650 has already been merged. ✔️
  2. A frontend-build upgrade - this PR also upgrades this package ✔️

Testing instructions

Run

make pull_translations

Manually translate some new extracted strings to be translated, for example for pt_PT locale add the next json lines to the file src/i18n/messages/frontend-app-course-authoring/pt_PT.json:

  "authoring.problemEditor.selectType.title": "Selecionar o tipo de problema",
  "authoring.problemeditor.selecttype.cancelButton.label": "Cancelar",
  "authoring.problemeditor.selecttype.selectButton.label": "Selecionar",

So when editing a "problem", URL: http://apps.local.openedx.io:2001/authoring/course/course-v1:OpenedX+DemoX+DemoCourse/editor/problem/block-v1:OpenedX+DemoX+DemoCourse+type@problem+block@59c24f8a4d5c46af8bfb5fc9cd4bb611

The modal title and action buttons will be translated/localized, view screenshot:
image

Related to:

@openedx-webhooks
Copy link

openedx-webhooks commented Apr 10, 2025

Thanks for the pull request, @igobranco!

This repository is currently maintained by @openedx/2u-tnl.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 10, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Apr 10, 2025
@igobranco igobranco self-assigned this Apr 10, 2025
@igobranco igobranco marked this pull request as draft April 10, 2025 09:20
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Apr 14, 2025
@igobranco igobranco force-pushed the igobranco/translations-add-plugins-i18n-extract branch from 1e5c279 to df49ac8 Compare April 16, 2025 10:59
Copy link

codecov bot commented Apr 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.89%. Comparing base (d8eda24) to head (817f651).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1802    +/-   ##
========================================
  Coverage   93.89%   93.89%            
========================================
  Files        1153     1153            
  Lines       24054    24054            
  Branches     5200     5096   -104     
========================================
  Hits        22585    22585            
- Misses       1392     1401     +9     
+ Partials       77       68     -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@igobranco igobranco moved this from Waiting on Author to Ready for Review in Contributions Apr 16, 2025
@igobranco igobranco requested a review from OmarIthawi April 16, 2025 12:03
@igobranco
Copy link
Contributor Author

@OmarIthawi can you review this?

@igobranco igobranco marked this pull request as ready for review April 16, 2025 12:04
igobranco added 2 commits May 13, 2025 16:07
Add the additional source `plugins` folder on the `fedx-scripts` extract translations.
This can be configured because the frontend-build v14.5.0 now supports additional source folders using the `--include` extra argument.
@igobranco igobranco force-pushed the igobranco/translations-add-plugins-i18n-extract branch from df49ac8 to 817f651 Compare May 13, 2025 15:12
@igobranco
Copy link
Contributor Author

Rebase on master to fix a git conflict.

@igobranco igobranco requested a review from bradenmacdonald May 13, 2025 15:26
@igobranco
Copy link
Contributor Author

@bradenmacdonald Can you review this PR, so we can improve localization?

Copy link
Member

@OmarIthawi OmarIthawi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @igobranco.

Looks good from my side. @brian-smith-tcril @bradenmacdonald would you mind merging this if all is okay? I don't have permissions to do so.

Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@brian-smith-tcril brian-smith-tcril merged commit 03a757d into openedx:master May 13, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Contributions May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants