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