Skip to content

feat(118n): make LanguageMenu reachable from the header - #316

Merged
arbrandes merged 9 commits into
openedx:mainfrom
eduNEXT:dcoa/lang-ui
Sep 22, 2026
Merged

arbrandes merged 9 commits into
openedx:mainfrom
eduNEXT:dcoa/lang-ui

Conversation

@dcoa

@dcoa dcoa commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

Moves the language selector into the header and presents it as a globe, per openedx/public-engineering#558 design.

LanguageMenu only lived in the footer, which is off screen on course units and Studio editing views. It now also sits in the header at every viewport, using one component shared by all placements.

It closes #284

Changes

Header placement

  • LanguageMenu moves from shell/footer/ to shell/menus/ and is registered in header.desktopRight.v1 and header.mobileRight.v1, after the user/anonymous menu. It stays in the footer.

Globe presentation

  • The toggle is a globe icon with the current language's full name at md and up, and the globe alone below. aria-label is "Change language: {language}" at every width.
  • Languages are always shown by full localized name.

Mobile menu (below sm)

  • The bar's globe steps aside, and a Paragon Collapsible (LanguageMenuCollapsible) is prepended to header.mobileMenuLinks.v1, so it's at the top of the hamburger menu.
  • The rows are Paragon MenuItems in a Menu, separated by dividers, with the selected language in the primary color and marked aria-current.
  • useLanguageSelection holds the switching logic (list, pending state, optimistic switch, error toast) shared by the dropdown and the collapsible.

Header styling, to match the design reference

  • The language toggle and the user menu are borderless (tertiary).
  • Sign in is a filled primary button, and Register now comes before it.

Fixes found along the way

  • Neither the shell's nor the test-site's index.html had a viewport meta tag, so the mobile header never rendered on phones or under device emulation.
  • The mobile menu's FocusOn now has scrollLock={false}. The lock's body[data-scroll-locked] margin collapsed the page when the menu opened. The menu content is also wrapped in the header's Container so it lines up with the bar.

Docs

  • docs/how_tos/i18n.rst lists the four widgets and shows how to REMOVE/REPLACE them.

Testing

  • Unit tests for LanguageMenu and LanguageMenuCollapsible, covering switching, the pending label, collapsed-by-default, and the error toast.
  • Manual, in the test site, signed in and signed out:
  • Configure some languages fost the test site (e.g. test-site/src/i18n/messages/{ar,es-419,pt_BR}.json). you can use AI for help.
    • Desktop: globe + name at the far right, after Sign in / the user menu.
    • 576–768px: mobile header with the globe on the bar.
    • Under 576px: no globe on the bar; the hamburger opens with the language collapsible first.
    • Switching language from each placement updates the UI and persists.
Screencast.from.2026-09-18.13-33-46.webm

Log in user:

image

Additional information

Supported by Claude

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Sep 18, 2026
@openedx-webhooks

openedx-webhooks commented Sep 18, 2026 •

Copy link
Copy Markdown

Thanks for the pull request, @dcoa!

This repository is currently maintained by @openedx/axim-engineering.

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.

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

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Sep 18, 2026
@dcoa dcoa changed the title feat(18n): make LanguangeMenu reacheable from header feat(18n): make LanguangeMenu reacheable from header Sep 18, 2026
@dcoa dcoa changed the title feat(18n): make LanguangeMenu reacheable from header feat(118n): make LanguageMenu reachable from the header Sep 18, 2026
@dcoa
dcoa marked this pull request as ready for review September 18, 2026 03:37
@dcoa
dcoa requested a review from arbrandes September 18, 2026 03:37
Comment thread shell/menus/LanguageMenu.tsx Outdated
Comment thread shell/menus/LanguageMenuCollapsible.tsx Outdated
Comment thread shell/header/app.tsx

@arbrandes arbrandes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tested it, and it's fabulous. Thanks, @dcoa!

@arbrandes
arbrandes merged commit 412973c into openedx:main Sep 22, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Contributions Sep 22, 2026
@openedx-semantic-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0-alpha.14 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U released on @alpha

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Make the language selector reachable from the shell header

4 participants