# Issue with Translation in Open edX Quince

**URL:** https://discuss.openedx.org/t/issue-with-translation-in-open-edx-quince/13050
**Category:** Site Operations Help
**Tags:** translation, quince, i18n, tutor, tutor-mfe
**Created:** [May 20, 2024, 11:16am UTC](https://discuss.openedx.org/t/issue-with-translation-in-open-edx-quince/13050 "2024-05-20T11:16:31Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Yaniv\_Gershon](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/yaniv_gershon/32/6847_2.png) [@Yaniv\_Gershon](https://discuss.openedx.org/u/Yaniv_Gershon)
#### Post date: [May 20, 2024, 11:16am UTC](https://discuss.openedx.org/t/issue-with-translation-in-open-edx-quince/13050/1 "2024-05-20T11:16:31Z")

</div>

Hi everyone,

I recently launched an Open edX Quince instance using Tutor on an EC2 instance running Ubuntu and selected Hebrew as the site language. However, I have encountered some issues: the LMS is only partially translated into Hebrew, and the MFE is entirely in English.

I followed the custom translation processes as per the Tutor documentation for the [LMS](https://docs.tutor.edly.io/configuration.html#adding-custom-translations) and [MFE](https://github.com/overhangio/tutor-mfe?tab=readme-ov-file#adding-custom-translations-to-your-mfes). I obtained the translations from Transifex and rebuilt both the Open edX platform and the MFE, but the translations have not been applied.

### Questions:

- How can I troubleshoot this issue?
- Did I miss something in the process?

Ultimately, I aim to add customized translations to Hebrew. Any advice or guidance would be greatly appreciated! Thanks in advance.

---

<div class="post-metadata">

### Author: ![vivek](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/vivek/32/6825_2.png) [@vivek](https://discuss.openedx.org/u/vivek)
#### Post date: [May 21, 2024, 5:36am UTC](https://discuss.openedx.org/t/issue-with-translation-in-open-edx-quince/13050/2 "2024-05-21T05:36:17Z")

</div>

hi @Yaniv_Gershon ,  
language of site is taken from user pref-lang configuration .  
so i did some modification function process\_response in this file  
`openedx/core/djangoapps/lang_pref/middleware.py` for complete site translation in Hebrew

```auto
def process_response(self, request, response): # lint-amnesty, pylint: disable=missing-function-docstring
        # If the user is logged in, check for their language preference. Also check for real user
        # if current user is a masquerading user,
        user_pref = None
        current_user = None
        if hasattr(request, 'user'):
            current_user = getattr(request.user, 'real_user', request.user)

        if current_user and current_user.is_authenticated:

            # DarkLangMiddleware has already set this cookie
            if DarkLangConfig.current().enabled and get_user_preference(current_user, DARK_LANGUAGE_KEY):
                return response

            anonymous_cookie_lang = getattr(request, '_anonymous_user_cookie_lang', None)
            if anonymous_cookie_lang:
                user_pref = anonymous_cookie_lang
                set_user_preference(current_user, LANGUAGE_KEY, anonymous_cookie_lang)
            else:
                # Get the user's language preference
                try:
                    user_pref = get_user_preference(current_user, LANGUAGE_KEY)
                except (UserAPIRequestError, UserAPIInternalError):
                    # If we can't find the user preferences, then don't modify the cookie
                    pass

            # If set, set the user_pref in the LANGUAGE_COOKIE_NAME
            if user_pref and not is_request_from_mobile_app(request):
                lang_pref_helpers.set_language_cookie(request, response, user_pref)
            else:
                lang_pref_helpers.unset_language_cookie(response)
        else:
            cookie_lang = lang_pref_helpers.get_language_cookie(request)
            if cookie_lang:
                lang_pref_helpers.set_language_cookie(request, response, cookie_lang)
            else:
                lang_pref_helpers.set_language_cookie(request, response, "he")
        return response

```

and for partially tranlslation , you can add your custom translation in `conf/locale/he/LC_MESSAGES/django.po` .  
hope it work for you

---

<div class="post-metadata">

### Author: ![Yaniv\_Gershon](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/yaniv_gershon/32/6847_2.png) [@Yaniv\_Gershon](https://discuss.openedx.org/u/Yaniv_Gershon)
#### Post date: [June 7, 2024, 6:44am UTC](https://discuss.openedx.org/t/issue-with-translation-in-open-edx-quince/13050/3 "2024-06-07T06:44:43Z")

</div>

Hi Vivek,

Thank you for your detailed response. We’ve identified that the main issue lies with the MFE (Micro-Frontend), which is entirely in English, and this problem persists for any language that is not English. Despite following the custom translation processes from the instructions in GitHub and obtaining translations from Transifex, the translations have not been applied.

Could you please provide additional guidance or solutions specifically for translating the MFE?

Thanks again for your help!

---

<div class="post-metadata">

### Author: ![vivek](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/vivek/32/6825_2.png) [@vivek](https://discuss.openedx.org/u/vivek)
#### Post date: [June 10, 2024, 5:34am UTC](https://discuss.openedx.org/t/issue-with-translation-in-open-edx-quince/13050/4 "2024-06-10T05:34:51Z")

</div>

hi @Yaniv_Gershon ,

> [@Yaniv\_Gershon](#):
>
> the main issue lies with the MFE (Micro-Frontend), which is entirely in English

This is because the language preference defaults to English if not explicitly set by the user. When the platform is first loaded, it defaults to English. If you want your site to support multiple languages, you can follow this guide: [How to Enable Multiple Languages for Your Open edX Platform](https://discuss.overhang.io/t/howto-enable-multiple-languages-for-your-open-edx-platform/140). Alternatively, if you want the platform to be in a specific language, you can follow my solution below

> [@vivek](#):
>
> language of site is taken from user pref-lang configuration .  
> so i did some modification function process\_response in this file  
> `openedx/core/djangoapps/lang_pref/middleware.py` for complete site translation in Hebrew

* * *

> [@Yaniv\_Gershon](#):
>
> guidance or solutions specifically for translating the MFE

**The way translation is handled in the MFEs differ from how the platform handles translations (which is Python gettext based).**

The translation framework in MFEs is based on formatjs ([Installation | Format.JS](https://formatjs.io/docs/getting-started/installation)).

Instead of .po files the translations lie in **.json files**. Every language has its own file (per MFE), so to override a specific string in all MFEs, we would have to override it in all translation files in all MFEs This also sometimes applies to decency pkgs, like header, footer…etc.  
For custom translations in MFE, you can modify your message files and provide translations in JSON format. Place the translations in the `i18n` folder structured as `i18n/messages/<language>.json`.  
for Example see screen shot below:

 ![Screenshot from 2024-06-10 10-54-49](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/0/05ca07077666dd7057746daeb4d15c8030f5a055.png)  
 ![Screenshot from 2024-06-10 10-53-14](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/a/a4d53f8029d3a22f87cf4065754b9a5d836fa731.png)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/e/e0015f89e879bc75925b71fd11133ab15fe98297.png) [@system](https://discuss.openedx.org/u/system)
#### Post date: [September 8, 2024, 5:35am UTC](https://discuss.openedx.org/t/issue-with-translation-in-open-edx-quince/13050/5 "2024-09-08T05:35:22Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
