Skip to content

fix: integrate RTL handling on locale changes (AU-2863)#48

Open
alenkadev wants to merge 4 commits intomasterfrom
alenka/fixing-arabic-language-dir-issue-on-edge-AU2863
Open

fix: integrate RTL handling on locale changes (AU-2863)#48
alenkadev wants to merge 4 commits intomasterfrom
alenka/fixing-arabic-language-dir-issue-on-edge-AU2863

Conversation

@alenkadev
Copy link
Copy Markdown

Title

AU-2863: Integrate RTL handling on locale changes in Learning MFE

Description

Problem

Arabic and other RTL-language course content displays with left-to-right text direction in the Learning MFE shell, despite correct rendering in other parts of the platform (Studio).

Solution

Integrated the platform's native handleRtl() function from @edx/frontend-platform/i18n to:

  • Apply correct text direction on app initialization (APP_READY)
  • Re-apply direction whenever user changes language preference (LOCALE_CHANGED)

Changes

  • Import handleRtl and LOCALE_CHANGED from frontend-platform i18n utilities
  • Subscribe to LOCALE_CHANGED event to handle dynamic language switches
  • Call handleRtl() during app startup before rendering

Scope

  • Affects navbar, sidebar, and all shell UI elements in the Learning MFE
  • Works in conjunction with courseware iframe template fix (in edx-platform) to ensure consistent RTL rendering across all LMS views
  • Supports RTL languages: Arabic (ar), Farsi (fa), Hebrew (he), Urdu (ur)

Copilot AI review requested due to automatic review settings April 21, 2026 06:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Integrates the platform RTL direction handler into the Learning MFE shell so the document direction is set correctly on initial load and when the user changes locale.

Changes:

  • Import handleRtl and LOCALE_CHANGED from @edx/frontend-platform/i18n.
  • Subscribe to LOCALE_CHANGED to re-apply RTL/LTR direction on dynamic language switches.
  • Call handleRtl() on APP_READY before rendering the React app.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.jsx
Comment thread src/index.jsx
Copy link
Copy Markdown
Member

@nsprenkle nsprenkle left a comment

Choose a reason for hiding this comment

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

In all my testing, the Learning MFE actually already applies the rtl directive correctly when the language is RTL, which is also what handleRtl does.

<html lang="en-us" dir="rtl" data-paragon-theme-variant="light" class="">
...

Are you able to demonstrate that any cases are fixed by adding the handleRtl function that we don't already have covered?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants