oTree Forum >

Localization couple of issues

#1 by chasmani


I'm using oTree 5.6.0. I ran into a couple of issues.

1. When I run `pybabel extract . -F babel.ini -o messages.pot -k trans` I get a `ModuleNotFoundError: No module named 'otree'` 
That's not a big deal for me because I can run that without the `-F babel.ini` to just find gettext strings from python files, which is what I wanted. But I thought you might want to know about the error. 

2. When I change the LANGAUGE_CODE in settings.py it automatically translates the core otree functionality such as "Next" buttons etc. That is great. However, when I create a "_locale" folder in order to store the .mo files for translations, the otree core messages stop getting translated. If I delete that folder the core messages get translated again, but then of course I lose the translations I made in the messages.mo file. This feels like a bug? Any idea of a workaround? 

Many thanks

#2 by Chris_oTree

I would need to look into it, but alternatively I would recommend the simpler localization technique shown in multi_language here: https://www.otreehub.com/projects/otree-snippets/

#3 by chasmani

Thanks Chris. Yes I'll try that technique. Simpler is often better. 


Write a reply

Set forum username