• Members 3 posts
    Feb. 20, 2021, 5:54 p.m.

    Hey! How can I change the translation (.po) in misago-docker?

  • edit

    Thread title has been changed from Locale misago-decker.

  • Feb. 24, 2021, 8:25 p.m.
    check_box

    Marked as best answer by Feb. 25, 2021, 12:58 p.m..

    You can create custom directory within misagodocker named extra_locale and put your language directory containing the mo and po files in it.

    Then you can create settings_override.py file in that directory with those contents:

    import os
    
    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    
    LOCALE_PATHS = [
      os.path.join(BASE_DIR, "extra_locale"),
    ]
    

    Then reload the site with ./appctl rebuild

  • Members 3 posts
    Feb. 25, 2021, 10:02 a.m.

    Thank you.

  • Members 38 posts
    March 16, 2023, 8:55 p.m.

    Should this still work? I put the files in the /root/misago_docker/misago/misagodocker/extra_locale folder: for_use_misago_django_hu.po and, for_use_misago_js-frontend_hu.po with settings_override.py with the code but it's not working.

    And i do ./appctl rebuild

  • March 16, 2023, 9:46 p.m.

    This is not going to work with Django's translation system ;)

    First, you can't just make extra_locale directory and throw in files into it. Inside the extra_locale you need to create directory named after locale code of language you are translating for. hu in your case. Inside hu directory there has to be extra directory named LC_MESSAGES. This LC_MESSAGES directory is where Django is looking for translation files.

    Next, you can't name your files anything. Those files must be named django.mo and djangojs.mo. You can compile PO files with translation sources to MO using manage.py compilemessages -l hu. But this will not work in misago-docker. Only with development setup which is available on main repo. :)