Skip to content

feat(i18n): add language preference management functionality - #19

Merged
andrey-canon merged 3 commits into
open-release/verawood.nelpfrom
and/FUTUREX-1469
Aug 13, 2026
Merged

feat(i18n): add language preference management functionality#19
andrey-canon merged 3 commits into
open-release/verawood.nelpfrom
and/FUTUREX-1469

Conversation

@andrey-canon

Copy link
Copy Markdown
Collaborator

Description

This adds a new language selector to the learning(used by learning) header and desktop(used by learner-dashboard) header

Issue # 1469
Migration pr of #14

How to test

  1. Checkout the required branches frontend-component-header and frontend-platform
  2. Set both dependencies as editable in your MFE,e.g
module.exports = {
    /*
    Modules you want to use from local source code.  Adding a module here means that when this app
    runs its build, it'll resolve the source from peer directories of this app.
  
    moduleName: the name you use to import code from the module.
    dir: The relative path to the module's source code.
    dist: The sub-directory of the source code where it puts its build artifact.  Often "dist".
    */
    localModules: [
        { moduleName: '@edx/frontend-platform', dir: '../frontend-platform', dist: 'src' },
        { moduleName: '@edx/frontend-component-header/dist', dir: '../frontend-component-header', dist: 'src' },
        { moduleName: '@edx/frontend-component-header', dir: '../frontend-component-header', dist: 'src' },
    ],
};
  1. Add the following settings to your local environment
MFE_CONFIG["SITE_SUPPORTED_LANGUAGES"] = ["en", "ar"]
MFE_CONFIG["ENABLE_HEADER_LANG_SELECTOR"] = True
  1. Download your MFE messages
    export PATH="$(pwd)/node_modules/.bin:$PATH"
    make OPENEDX_ATLAS_PULL=true ATLAS_OPTIONS="--repository=nelc/futurex-translations --revision=open-release/redwood.master" pull_translation
  2. Go to your mfe an check the language selector behavior
2026-08-11.14-34-04.mp4

andrey-canon and others added 3 commits August 11, 2026 09:49
* feat(i18n): add language preference management functionality

* fix: force page reload to ensure complete translation application

* feat: conditional page reloading and module rename

* refactor(i18n): move language preference functions to languageApi module

* test(i18n): add unit tests for languageApi and languageManager functions

* feat(i18n): add getSupportedLocales function

* feat(i18n): update user preferences function

* feat(i18n): update getSupportedLocaleList function

---------

Co-authored-by: Andres Felipe Giraldo Malagon <andres.giraldo@edunext.co>

@johanseto johanseto left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Working in my local env.

Screencast.from.13-08-26.09.40.37.webm

@andrey-canon
andrey-canon changed the base branch from and/FUTUREX-1453 to open-release/verawood.nelp August 13, 2026 18:05
@andrey-canon
andrey-canon merged commit cd3371c into open-release/verawood.nelp Aug 13, 2026
3 checks passed
@andrey-canon
andrey-canon deployed to open-release/verawood.nelp August 13, 2026 18:06 — with GitHub Actions Active
@andrey-canon
andrey-canon deployed to open-release/verawood.nelp August 13, 2026 18:06 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants