Custom translations not working for authn mfe app

Hi everyone, I tried following the guide of placing a custom translation file under

env/plugins/mfe/build/mfe/i18n/authn/es.json

The openedx locale is set to es. the main page shows up in spanish, when I click register it routes to the authn mfe and this mfe is always in english.

I tried with various languages,
tried placing the json file in various directories,
tried debugging by checking the logs when rebuilding the mfe image. I found some logs that say that it finds the json file and copies it over to the messages directory.
I believe I am missing something simple of why the mfe is always in english, it seems like it just doesn’t pick up the setting that it should be in a different language.

Has anyone faced such an issue? Does anyone know how I could debug the problem of why the mfe app does not pick up the json translations? Literally been stuck on this for 2 days.

tried using es_419.json and in the logs I see that the merging happens and the mfe images gets rebuilt. However still the authn page is all in english.

Also tried changing my browser settings and using different browser but no luck.

Hi @minde,

I just share my experience with zh_CN.json adding custom translation file with traditional chinese in \env\plugins\mfe\build\mfe\i18n\authn. And then build image and then push image because MFE_DOCKER_IMAGE is defined in config.yml which are point to my own Docker.io repo. I hope my sharing can help you.

Thanks @KFC_kenneth appreciate you help. I tried building an image using custom tag with such command:

docker buildx build --tag=overhangio/mindefr:1.0.1 --output=type=docker --progress=plain --cache-from=type=registry,ref=overhangio/openedx-mfe:17.0.0-cache

picked french so there is no confusion in terms of using es.json or es_419.json

in the logs I see this when building the image:

29 Merging i18 strings from /openedx/app/src/i18n/messages/fr.json with /openedx/i18n/authn/fr.json to /openedx/app/src/i18n/messages/fr.json
#80 1.233 {
#80 1.233 ‘start.learning’: “Démarrer l’apprentissage”,
#80 1.233 ‘with.site.name’: ‘avec {siteName}’,
#80 1.233 ‘your.career.turning.point’: ‘Your career turning point’,
#80 1.233 ‘is.here’: ‘is here.’,
#80 1.233 ‘welcome.to.platform’: ‘Bienvenue sur {siteName}, {username}!’,

(printed additional info by changing the merge script) all the translations look correct. I started tutor mfe app using the custom docker tag and updated the MFE_DOCKER_IMAGE variable accordingly.

still the authentication app shows up in english. To me this looks like there could be some bug? Because the documentation makes it sound like you just add the json file rebuild image and you are good to go?

Not sure what else can be checked. I saw references to some language cookie in the code but not sure what it does.

If anybody has any pointers it would be very appreciated.

@KFC_kenneth how did you rebuild the image? I am thinking if it might be some cache issue when rebuilding the image using tutor images build mfe?

I see there is --no-cache options but to me building without cache fails:

[course-authoring-common 3/5] RUN --mount=type=cache,target=/root/.npm,sharing=shared npm clean-install --no-audit --no-fund --registry=https://registry.npmjs.org/:

78.65 npm ERR! code ECONNRESET

78.65 npm ERR! network Client network socket disconnected before secure TLS connection was established

78.65 npm ERR! network This is a problem related to network connectivity.

78.65 npm ERR! network In most cases you are behind a proxy or have bad network settings.

78.65 npm ERR! network

78.65 npm ERR! network If you are behind a proxy, please make sure that the

78.65 npm ERR! network ‘proxy’ config is set properly. See: ‘npm help config’

78.90

78.90 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-03-22T13_36_30_401Z-debug-0.log


Looks like only authn mfe is not getting translated. learner dashboard and account mfes look to be in french.

apparently openedx-language-preference cookie was not set. If I set to fr, then it works, and my custom translations also show up. will read about this a bit later, finally solved the blocking issue. thanks @KFC_kenneth for the help.

Hello @minde I have the same issue. Did you find out how to set the open edx-language-preference cookie?

Sadly no, I have been looking at other parts of translating openedx. Good luck rax, if you find anything please do share!