# Changing translations has no effect

**URL:** https://discuss.openedx.org/t/changing-translations-has-no-effect/11998
**Category:** Site Operations Help
**Tags:** palm, how-to, quince, tutor
**Created:** [December 30, 2023, 10:46am UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998 "2023-12-30T10:46:18Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![FatemeKhodayari](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/fatemekhodayari/32/5614_2.png) [@FatemeKhodayari](https://discuss.openedx.org/u/FatemeKhodayari)
#### Post date: [December 30, 2023, 10:46am UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/1 "2023-12-30T10:46:18Z")

</div>

Hi. I’m running openedx quince.1 on local and palm.4 in production. We need to change the course end date description translations. I changed the translations from `tutor/env/build/openedx/locale/<my-locale>/LC_MESSAGES/django.po` and then rebuilt the openedx image using `tutor images build openedx` and re-launched but nothing changed.

I even tried running `python manage.py lms compilemessages` in the lms container but the translations are still the same as the original. This problem exists in both palm and quince. This is the section I’m talking about:

![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/d/dff5c8c0835cf089c815b162d7bffe07ff505bb2.png)

I also tried copying the django.po file to the container and running `python manage.py compilemessages` from inside container but still no change.

---

<div class="post-metadata">

### Author: ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)
#### Post date: [January 12, 2024, 11:55am UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/2 "2024-01-12T11:55:30Z")

</div>

What is the content of your django.po file?

---

<div class="post-metadata">

### Author: ![FatemeKhodayari](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/fatemekhodayari/32/5614_2.png) [@FatemeKhodayari](https://discuss.openedx.org/u/FatemeKhodayari)
#### Post date: [January 13, 2024, 12:39pm UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/3 "2024-01-13T12:39:56Z")

</div>

A bunch of standard msgstr and msgid. For example this specific line looks like this:

```auto
#: lms/djangoapps/courseware/date_summary.py
msgid ""
"After the course ends, the course content will be archived and no longer "
"active."
msgstr ""
"Replace this string!!"

```

Same problem exists with this one:

```auto
#. #-#-#-#-# django-partial.po (edx-platform) #-#-#-#-#
#. Translators: 'Discussion' refers to the tab in the courseware that leads to
#. the discussion forums
#: cms/djangoapps/contentstore/views/component.py
#: lms/djangoapps/courseware/tabs.py lms/djangoapps/discussion/plugins.py
#: openedx/core/djangoapps/discussions/plugins.py
#: openedx/features/lti_course_tab/tab.py xmodule/discussion_block.py
#: lms/djangoapps/discussion/templates/discussion/discussion_profile_page.html
#: lms/templates/ux/reference/bootstrap/course-skeleton.html
msgid "Discussion"
msgstr "Replace this!!"

```

---

<div class="post-metadata">

### Author: ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)
#### Post date: [January 22, 2024, 8:56am UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/4 "2024-01-22T08:56:39Z")

</div>

The translation strings that you are trying to replace do not actually appear in edx-platform, but in the learning microfrontend (MFE). Notice that they are present in “http(s):// **apps**.yourlms.com” pages. The “apps” prefix indicates an MFE. You should customize these strings using a different approach: [GitHub - overhangio/tutor-mfe: This plugin makes it possible to easily add micro frontend (MFE) applications on top of an Open edX platform that runs with Tutor.](https://github.com/overhangio/tutor-mfe/#adding-custom-translations-to-your-mfes)

---

<div class="post-metadata">

### Author: ![FatemeKhodayari](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/fatemekhodayari/32/5614_2.png) [@FatemeKhodayari](https://discuss.openedx.org/u/FatemeKhodayari)
#### Post date: [January 22, 2024, 1:13pm UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/5 "2024-01-22T13:13:52Z")

</div>

Thanks for the response but I don’t agree with you. The content for the tabs in learning MFE is returned from server I believe. Look at this API call please.

```auto
https://mylms.com/api/course_home/course_metadata/course-id

```

It’s a get request sent from learning MFE to LMS when the page is loading. The response to this request looks like this:

```auto
{
    "can_show_upgrade_sock": false,
    "verified_mode": null,
    "celebrations": {
        "first_section": false,
        "streak_length_to_celebrate": null,
        "streak_discount_enabled": false,
        "weekly_goal": false
    },
    "course_access": {
        "has_access": true,
        "error_code": null,
        "developer_message": null,
        "user_message": null,
        "additional_context_user_message": null,
        "user_fragment": null
    },
    "course_id": "course-id",
    "is_enrolled": true,
    "is_self_paced": false,
    "is_staff": true,
    "number": "course-id",
    "org": "myorg",
    "original_user_is_staff": true,
    "start": "2023-10-07T12:30:00+03:30",
    "tabs": [
        {
            "tab_id": "courseware",
            "title": "دوره آموزشی",
            "url": "https://apps.mylms.com/learning/course/course-id/home"
        },
        {
            "tab_id": "progress",
            "title": "پیشرفت",
            "url": "https://apps.mylms.com/learning/course/course-id/progress"
        },
        {
            "tab_id": "dates",
            "title": "تاریخ‌ها",
            "url": "https://apps.mylms.com/learning/course/course-id/dates"
        },
        {
            "tab_id": "discussion",
            "title": "گفتگو",
            "url": "https://apps.mylms.com/discussions/course-id/"
        },
        {
            "tab_id": "instructor",
            "title": "مربی",
            "url": "https://mylms.com/courses/course-id/instructor"
        }
    ],
    "title": "my course",
    "username": "admin",
    "user_timezone": null,
    "can_view_certificate": true
}

```

So I guess the tabs, their name and their url is generated from this response. So the translations are coming from LMS in my opinion.

---

<div class="post-metadata">

### Author: ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)
#### Post date: [January 22, 2024, 1:53pm UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/6 "2024-01-22T13:53:03Z")

</div>

You are absolutely right, and I was wrong. On my local platform, the translated string comes from the following url: [http://local.edly.io/api/course\_home/outline/course-v1:edX+DemoX+Demo\_Course](http://local.edly.io/api/course_home/outline/course-v1:edX+DemoX+Demo_Course)

So overriding the translations in a django.po file _should_ work. Indeed, I am able to override the “After the course ends” string by creating a ~/.local/share/tutor/env/build/openedx/locale/fr/LC\_MESSAGES/django.po file with the following content:

```auto
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8"

msgid ""
"After the course ends, the course content will be archived and no longer "
"active."
msgstr ""
"POUAC!"

```

As per [the docs](https://docs.tutor.edly.io/configuration.html#adding-custom-translations).

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/8/8d0a6891ff6515504159b068cd3ba564935e4c31.png)  
(notice the “POUAC!” string in the right column)

If the same approach does not work for you, it might be because your django.po file is incorrectly formatted. You might glean more information by running:

```auto
tutor local run --no-deps lms bash
cd ../locale/user
django-admin compilemessages -v1 -l yourlocale

```

---

<div class="post-metadata">

### Author: ![FatemeKhodayari](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/fatemekhodayari/32/5614_2.png) [@FatemeKhodayari](https://discuss.openedx.org/u/FatemeKhodayari)
#### Post date: [January 22, 2024, 2:36pm UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/7 "2024-01-22T14:36:56Z")

</div>

Good to hear it’s working for you, but it’s still not working for me : (

I ran the `django-admin compilemessages -v1 -l fa_IR` from within the container as you said. The files compiled fine with no errors but my translations are still the same. This is getting really frustrating.

---

<div class="post-metadata">

### Author: ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)
#### Post date: [January 22, 2024, 3:01pm UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/8 "2024-01-22T15:01:49Z")

</div>

What’s the current user configured language? (from the “account” page) Mine is configured as “Français” (French).

---

<div class="post-metadata">

### Author: ![FatemeKhodayari](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/fatemekhodayari/32/5614_2.png) [@FatemeKhodayari](https://discuss.openedx.org/u/FatemeKhodayari)
#### Post date: [January 22, 2024, 3:21pm UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/9 "2024-01-22T15:21:15Z")

</div>

It’s set to Persian (Iran). Language code is set to `fa-ir` in `https://mylms.com/update_lang/` as well.

I deleted the translation file. Created it again, pasted the content from the original file and now, finally it’s working!  
I still don’t know what was wrong with the original file. Cause it gave no errors during build / compilemessages and compiled successfully. As I said in the first post, I even copied the file into the container and ran compilemessages and it still wasn’t working. Now I just deleted it, and added the exact same content, copy paste literally, and finally it’s ok!

The even more strange part is that, this issue didn’t happen with all changes in the original file. Just some of the words had this issue and other translation changes were working just fine.

---

<div class="post-metadata">

### Author: ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)
#### Post date: [January 22, 2024, 5:07pm UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/10 "2024-01-22T17:07:00Z")

</div>

You almost certainly had a syntax error in your po file. You can check your syntax with:

```
msgfmt --check ~/.local/share/tutor/env/build/openedx/locale/.../django.po

```

---

<div class="post-metadata">

### Author: ![FatemeKhodayari](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/fatemekhodayari/32/5614_2.png) [@FatemeKhodayari](https://discuss.openedx.org/u/FatemeKhodayari)
#### Post date: [January 23, 2024, 1:14pm UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/11 "2024-01-23T13:14:38Z")

</div>

The funny thing is that this command returns no error for the original file :)))  
By the way, I thought that if a translation file has syntax error, the compile process will fail. Won’t it?

---

<div class="post-metadata">

### Author: ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)
#### Post date: [January 23, 2024, 1:42pm UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/12 "2024-01-23T13:42:24Z")

</div>

I honestly have no idea…

---

<div class="post-metadata">

### Author: ![FatemeKhodayari](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/fatemekhodayari/32/5614_2.png) [@FatemeKhodayari](https://discuss.openedx.org/u/FatemeKhodayari)
#### Post date: [January 23, 2024, 1:43pm UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/13 "2024-01-23T13:43:34Z")

</div>

Me too :)) But thanks a lot for your time and help.

---

<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: [April 22, 2024, 1:43pm UTC](https://discuss.openedx.org/t/changing-translations-has-no-effect/11998/14 "2024-04-22T13:43:39Z")

</div>

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