Skip to content

feat: add language selector component to header #586

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Ang-m4
Copy link

@Ang-m4 Ang-m4 commented Apr 2, 2025

Language Selector Implementation

Description

This pull request proposes a new LanguageSelector component that enables users to change the site language using a paragon dropdown.

Features

  • Responsive design that shows:
    • Only the language icon on small screens (< 576px)
    • Language code (e.g., "EN") on medium screens (576px-767px)
    • Full language name (e.g., "English") on large screens (≥ 768px)
  • Configurable through platform settings

Changes

  • LanguageSelector.jsx: Main component implementation
  • LanguageSelector.scss: Styling with media queries
  • LanguageSelector.test.jsx: Testing logic for the component
  • index.js: Export file for the component

Integration

The component is integrated into both header types:

  • Added to LearningHeader.jsx for the learning experience
  • Added to HeaderBody.jsx for Studio

Both implementations are conditional based on the ENABLE_HEADER_LANG_SELECTOR configuration flag, making it easy to enable/disable.

Related Work

This implementation relies entirely on the proposed LanguageManagement feature. For more details, please refer to the related pull request: Language Management PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 2, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented Apr 2, 2025

Thanks for the pull request, @Ang-m4!

This repository is currently maintained by @openedx/committers-frontend.

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.

@Ang-m4
Copy link
Author

Ang-m4 commented Apr 3, 2025

Hey @dcoa! 😊 I built on your changes from your PR and would love for you to take a look when you have a chance. Let me know what you think! Thanks!

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Needs Tests Run or CLA Signed in Contributions Apr 7, 2025
@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Apr 7, 2025
@e0d
Copy link

e0d commented Apr 18, 2025

@Ang-m4 I've added you to the openedx-triage team as you are covered under an entity CLA. This will mean that tests will run automatically when you submit a pull request in the future. Please look for an invitation in your email and accept it.

Copy link

codecov bot commented Apr 18, 2025

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 70.04%. Comparing base (8ef3a27) to head (48a1e4e).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/language-selector/LanguageSelector.jsx 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #586      +/-   ##
==========================================
+ Coverage   68.75%   70.04%   +1.29%     
==========================================
  Files          48       49       +1     
  Lines         432      454      +22     
  Branches       97      102       +5     
==========================================
+ Hits          297      318      +21     
- Misses        132      133       +1     
  Partials        3        3              

☔ 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.

@e0d
Copy link

e0d commented Apr 18, 2025

@Ang-m4 I notice there are some commit-lint failures. Please note that we use conventional commits across Open edX projects. You can read about the details here. Can you please amend your commit messages to follow our standard?

@e0d e0d removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Apr 18, 2025
@e0d e0d moved this from Needs Tests Run or CLA Signed to Waiting on Author in Contributions Apr 18, 2025
@Ang-m4
Copy link
Author

Ang-m4 commented Apr 19, 2025

@Ang-m4 I notice there are some commit-lint failures. Please note that we use conventional commits across Open edX projects. You can read about the details here. Can you please amend your commit messages to follow our standard?

Hi @e0d, thanks for catching that! Looks like I added an extra "s" to "style"... I'll go ahead and update the commit messages to follow the convention. Appreciate the heads-up!.

@Ang-m4 Ang-m4 force-pushed the afg/language-selector-imp branch from f958c4f to 14b8cc5 Compare April 19, 2025 15:54
@Ang-m4 Ang-m4 force-pushed the afg/language-selector-imp branch from 14b8cc5 to 48a1e4e Compare April 22, 2025 18:26
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: Waiting on Author
Development

Successfully merging this pull request may close these issues.

4 participants